Hi
If I execute the following code snippets and trace the db queries with SQL Server Profiler, both snippets produce the same query: Only one insert query. But nothing about any transactional behaviour. If I run two (longer running) concurrent transactions, they aren't executed as atomic blocks.
Here are the code snippets - one with and one without transaction:
Code:
ISession session = NHibernateSessionFactory.CreateSession();
ITransaction tx = session.BeginTransaction();
Artikel a = new Artikel();
a.Bezeichnung = "new";
session.Save(a);
tx.Commit();
session.Close();
Code:
ISession session = NHibernateSessionFactory.CreateSession();
Artikel a = new Artikel();
a.Bezeichnung = "new";
session.Save(a);
session.Close();
(NHibernateSessionFactory configures the ISessionFactory in its static constructor and returns an OpenSession() when you call NHibernateSessionFactory.CreateSession())
I'm using MS SQL Server 2005 and NHibernate V1.0.3. The default isolation level is set to Serializable in ISessionFactory config. Any ideas why transactions don't work?
Thanks, Domi