Revision: 5531
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5531&view=rev
Author: patearl
Date: 2011-03-25 19:41:12 +0000 (Fri, 25 Mar 2011)
Log Message:
-----------
NH2228: Eliminated concurrent transactions to prevent SQLite deadlock.
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2228/Fixture.cs
Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2228/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2228/Fixture.cs 2011-03-25 17:52:43 UTC (rev 5530)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2228/Fixture.cs 2011-03-25 19:41:12 UTC (rev 5531)
@@ -51,20 +51,22 @@
{
using (var scenario = new ParentWithTwoChildrenScenario(Sfi))
{
- using (var client1 = OpenSession())
- using (var tx1 = client1.BeginTransaction())
- {
- var parentFromClient1 = client1.Get<Parent>(scenario.ParentId);
- NHibernateUtil.Initialize(parentFromClient1.Children);
- var firstChildId = parentFromClient1.Children[0].Id;
-
- DeleteChildUsingAnotherSession(firstChildId);
+ using (var client1 = OpenSession())
+ {
+ var parentFromClient1 = client1.Get<Parent>(scenario.ParentId);
+ NHibernateUtil.Initialize(parentFromClient1.Children);
+ var firstChildId = parentFromClient1.Children[0].Id;
- parentFromClient1.Children[0].Description = "Modified info";
+ DeleteChildUsingAnotherSession(firstChildId);
+
+ using (var tx1 = client1.BeginTransaction())
+ {
+ parentFromClient1.Children[0].Description = "Modified info";
var expectedException = tx1.Executing(x => x.Commit()).Throws<StaleObjectStateException>().Exception;
- expectedException.EntityName.Should().Be(typeof(Child).FullName);
- expectedException.Identifier.Should().Be(firstChildId);
- }
+ expectedException.EntityName.Should().Be(typeof (Child).FullName);
+ expectedException.Identifier.Should().Be(firstChildId);
+ }
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|