I want to have something like sub-transactions, in that you can mark a
point where you would start the sub-transaction, then at the point of
descision for that bit, you can either roll-back (abort the sub-bit)
or carry on, effectively commiting, when the out transation commits.
Of course, if you abort the outer transaction, the marked bit aborts
too.
How can I do that with NHibernate. Can I have an example please.
My code is as follows:
API.Data.Session session = API.Data.SessionManager.GetSession();
session.BeginTransaction();
try
{
Project project = Project.Load(ID);
...........
Save(project);
.....................
session.CommitTransaction();
}
catch
{
session.RollbackTransaction();
throw;
}
.............................................................................................................................................................
public void save(Project project)
{
Data.SessionManager.GetSession().BeginTransaction();
try
{
Save();
LogIssueChange(test);
Data.SessionManager.GetSession().CommitTransaction();
}
catch
{
Data.SessionManager.GetSession().RollbackTransaction();
throw;
}
}
--
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.