G
GaryDean
I'm using TransactionScope as follows...
using TransactionScope myScope = new TransactionScope())
{
using (SqlConnection conn = new SqlConnection())
{
conn.ConnectionString = GlobalData.connString;
conn.Open();
...................code that does db work
myScope.Complete();
}//dispose of connection
}//dispose of myScope
The code calls down the call chain where all of the database work gets done.
and all of this, so far, works just fine.
However, I put some code in the Application_Error event in Global.asax to
log exception data to a SQL Server Database table. The code works but it's
getting rolled back when the unhandled exception occurs within the scope.
Is there any way I can keep these updates in the Application_Error event
from getting rolled back?
using TransactionScope myScope = new TransactionScope())
{
using (SqlConnection conn = new SqlConnection())
{
conn.ConnectionString = GlobalData.connString;
conn.Open();
...................code that does db work
myScope.Complete();
}//dispose of connection
}//dispose of myScope
The code calls down the call chain where all of the database work gets done.
and all of this, so far, works just fine.
However, I put some code in the Application_Error event in Global.asax to
log exception data to a SQL Server Database table. The code works but it's
getting rolled back when the unhandled exception occurs within the scope.
Is there any way I can keep these updates in the Application_Error event
from getting rolled back?