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

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -