Hello!

I have problem with exception handling when I'm committing
transactions.
I have only one long-life session in my application (MySession). When
I'm trying to delete an object:

var transaction = MySession.BeginTransaction();
MySession.Delete(item);

and I recieve an exception from database I call:

transaction.Rollback();

But when I'm trying later to save my another object I'm getting the
same error from my previous operation (deleting). It seems that
MySession keeps old exceptions, but why? Rollback is not enough?

I read in the NH Documentation:
"If the ISession throws an exception you should immediately rollback
the transaction, call ISession.Close() and discard the ISession
instance. Certain methods of ISession will not leave the session in a
consistent state."

But I can't close MySession, because I have many other controls and
windows that uses objects from MySession. Closing MySession I close my
proxy. I need the instances from MySession with their proxys.

So please help :)
Chris.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to