I have to do something like sub-transaction, in which you can mark a point where you sub-transaction When you start for that bit, you can either roll-back (abort the sub-bit) or reduce it effectively, when the out transmission is reduced. Of course, if you cancel the external transaction, the marked bit also stops.
How can I do this with NHibernate, but the transaction is being discontinued during fisrt commit and thus I get the error message
to make an open transaction
My code is as follows:
API.Data.Session session = API Data.SessionManager.GetSession (); Session.BeginTransaction (); Try {Project Project = Project. Load (id); ........... save project); ..................... session Communication transaction (); } Hold {session.RollbackTransaction (); throw; } Public Zero Save (Project Project) {Data.SessionManager.GetSession (). StartupCurrent (); Try {Save ()) LogIssueChange (test); . Data.SessionManager.GetSession () CommitTransaction (); } Hold {Data.SessionManager.GetSession (). RollbackTransaction (); throw; Note through the nested transaction and TransactionScope / code> Class AFAIK Supported by SQL Server and Oracle, although it can work for other databases if they have an API plugging system along with distributed transactions.
See these SO questions
Comments
Post a Comment