Joined: Tue Jul 15, 2008 3:55 pm Posts: 5
|
Am new to nHibernate.I have some problem after commiting the data to database.
If you see the follwing code after "Step 2" the control is going to "Step 4" then exiting the mehtod with out going to "Step 3".Practically it should go to "Step 3" after "Step 4" then it should exit the method.
I could not able to understand what is happening behind the scenes.
Note:My updates were successfull and they written to DaataBase
could some one help me..
_session = _sessionFactory.OpenSession();
ITransaction txBridgeInfo = null;
try
{
txBridgeInfo = _session.BeginTransaction();
_session.SaveOrUpdate(item); --->Step 1
txBridgeInfo.Commit(); --->Step 2
} --->Step 3
catch (Exception ex)
{
if (txBridgeInfo != null)
txBridgeInfo.Rollback();
throw ex;
}
finally
{
_session.Close(); --->Step 4 }
}
Last edited by don_don on Wed Jul 23, 2008 10:07 am, edited 3 times in total.
|
|