Dears, i have a exception logger and i need to save exceptions in database with datetime, but it is not saving. i am calling a function is my catch block to insert a record in exceptions table , but when i do so it gives me the actual exception occured and does not saves the exception in database. it seems issue with transaction handling, i openeed a new transaction but still the same.

pls help. Thanks han

Updated at 31.07.2010 9:07:59

Dear Alex, sorry but how should i do this in different session/transaction. i am doing something like this : using (var session = Session.Open(DomainBuilder.Domain)){} but still the same error..pls give some sample code to how to forcely open a new session /transaction..its over a month i am testing DO but unfortunately could not get hold of these basics...i want to understand these concepts completely especially Session and Transactions...becuase we will be heavily dependant on this. i understnad that session is equivalent to db connection, but how to open /close new session/transaction or use existing session/ transaction.

pls suggest.i cant move ahead if these concepts are not clear. thanks HAN

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Jul 29 '10 at 13:12

HannanKhanji's gravatar image


edited Sep 03 '10 at 15:45

Alex%20Yakunin's gravatar image

Alex Yakunin

One Answer:

You should do this in different Session and transaction: normally original transaction is already rolled back at this point, and thus Session where this happened is unusable until the outermost Transaction.Open block (i.e. outermost transaction scope for this Session) won't be left.

answered Jul 29 '10 at 21:07

Alex%20Yakunin's gravatar image

Alex Yakunin

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA