transactionscope - NHibernate transaction: Why does this result in committed data? -


The following code displays a misleading state in which the data is committed to the database, even if it never calls on less transactions

Can anyone be explained?

  [TestFixture] Public class testfactext {[test] Public Zero Test () {var config = DoConfiguration (); (Var factory = config.BuildSessionFactory ()) ({var session = factory.OpenSession ()) {CallSessionContext.Bind (session); (New TransactionEdit ()) using {session.BeginTransaction ()) {var myEntity = session. Cutte ("From My Entity"). List & lt; MyEntity & gt; () [0]; MyEntity.Name = "test name"; } Var myEntity2 = session. Cutte ("From My Entity"). List & lt; MyEntity & gt; () [0]; MyEntity2.Name = "test name"; Session.Flush (); } CallstationTontex. Uniband (factory); }}}}}  

explicitly calling session.flush () Continues your changes, discussed in detail in this


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -