Hi there, 
        
The issue AR-ISSUE-249 was just created by Yuriy Ostapenko (yuriy.ostapenko).
        
        Key: AR-ISSUE-249
        Summary: SessionScope commits on dispose with 
DefaultFlushType.Transaction
        Type: Bug
        Importance: High
        
        Description:
        According to XML documentation, DefaultFlushType.Transaction means:
"SessionScope won't flush at all unless called manually, TransactionScope 
flushes automatically.", which is exactly what we need.
However, SessionScope creates an implicit transaction and commits both session 
and transaction on dispose.
Test:
[Test]
public void TransactionalAutoCommitImplicitTransaction()
{
        ActiveRecordStarter.Initialize(GetConfigSource(), typeof(Post), 
typeof(Blog));
        Recreate();
        Post.DeleteAll();
        Blog.DeleteAll();
        
((InPlaceConfigurationSource)ActiveRecordStarter.ConfigurationSource).DefaultFlushType
 = DefaultFlushType.Transaction;
        using (new SessionScope())
        {
                var blog = new Blog();
                blog.Save();
        }
        using (new SessionScope())
        {
                var blog = Blog.FindAll()[0];
                blog.Name = "TestBlog";
        } // The blog is being saved here without explicit Save() call!
        using (new SessionScope())
        {
                var blog = Blog.FindAll()[0].Name;
                Assert.AreEqual("TestBlog", blog);
        }
}
        
For more, see 
http://support.castleproject.org/projects/AR/issues/view/AR-ISSUE-249
 
        
--
donjon
by Castle Stronghold
http://www.castle-donjon.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to