Hi, I want to know the reasons that make transaction rollback , also I handled the event Session.Events.TransactionRollbacking but the parameters don't give me any reasons

asked Feb 27 '11 at 02:24

Hala%20Aly's gravatar image

Hala Aly

Is there is any body to answer me??????????

(Feb 28 '11 at 04:38) Hala Aly Hala%20Aly's gravatar image

Hello Hala Aly.

We are working on your request.

(Feb 28 '11 at 04:40) Dmitri Maximov Dmitri%20Maximov's gravatar image

One Answer:

Hello again,

There are mainly 2 reasons that cause a transaction to rollback. First case is manually called Transaction.Rollback method. The second one is an exception caught while executing Transaction.Commit method. The only way today to get the info about the exception that causes the rollback is to catch it manually.

As for now there is no way to get information about the exception in Session.Events.TransactionRollbacking event, we should definitely add this info there. Stay tuned.

answered Feb 28 '11 at 05:20

Dmitri%20Maximov's gravatar image

Dmitri Maximov

Thanks for reply, but my case is: I handled the two events Session.Events.TransactionRollbacking and Events_TransactionCommitted and there is no exception occur and the transaction rollbacked and I don't know why???so, I need to know why the transaction is rollbacking.Can any event or property help me in this case

(Feb 28 '11 at 05:55) Hala Aly Hala%20Aly's gravatar image

Just to check: Do you call TransactionScope.Complete() method according to this pattern?

using (var ts = session.OpenTransaction()) {

  // your code here
  ts.Complete(); // last line before closing the region
(Feb 28 '11 at 06:11) Dmitri Maximov Dmitri%20Maximov's gravatar image

yes,I use this and also session.SaveChanges()

(Feb 28 '11 at 06:19) Hala Aly Hala%20Aly's gravatar image

It seems that your case is a bit tricky (rollback happens with no visible exceptions). Could you send us your project to get the ability to dig deeper and sort out the problem? The absolute confidence is guaranteed.

The e-mail is: support [at] x-tensive.com.

(Feb 28 '11 at 06:25) Dmitri Maximov Dmitri%20Maximov's gravatar image
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


Once you sign in you will be able to subscribe for any updates here



Asked: Feb 27 '11 at 02:24

Seen: 2,538 times

Last updated: Feb 28 '11 at 06:25

powered by OSQA