N
nashak
We are logging errors into a table (yeah, I know what happens if db
access throws exceptions).
My parent method sets up a connection, opens connection and begins a
transaction. It then calls several methods and passes them the
connection and transaction objects. Now when an exception is thrown, I
create another method and have to now create a new connection to access
my DB table. I cannot use the original connection as in that case it
wants my sql commands to be bound to the parent transaction. After
logging the error, the exception passes to the try-catch block of
parent method that rollsback the transaction. However, I cannot create
a separate transaction in my LogError method even though I am using a
new connection object since the parent rollback also rollsback the
LogError write to the table. Any suggestion on how to go about fixing
this?
Thanks,
access throws exceptions).
My parent method sets up a connection, opens connection and begins a
transaction. It then calls several methods and passes them the
connection and transaction objects. Now when an exception is thrown, I
create another method and have to now create a new connection to access
my DB table. I cannot use the original connection as in that case it
wants my sql commands to be bound to the parent transaction. After
logging the error, the exception passes to the try-catch block of
parent method that rollsback the transaction. However, I cannot create
a separate transaction in my LogError method even though I am using a
new connection object since the parent rollback also rollsback the
LogError write to the table. Any suggestion on how to go about fixing
this?
Thanks,