-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: TransactionScope problem
PostPosted: Mon May 22, 2006 3:47 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi all,

Im´trying to use TransactionScope, but in some cases the rollback doesn´t work.
For example: I insert the obj1 correctely, but when try insert obj2 occurs an normally error
defined by myself, BUT the obj1 was already inserted to database and it doesn´t roll back.
This occurs and on TO, but and other not occurs.

Code:
using (TransactionScope scope = NHibernateUtil.GetNewScope(TransactionScopeOption.Required))
{
     FamilyTO familyTO = new FamilyTO();

      try
      {
          otherBO.insert(obj1);// It has transaction scope too...

       thisDAO.insert(obj2);

         NHibernateUtil.CommitTransaction();
     }
     catch (Exception exception)
      {
             NHibernateUtil.RollbackTransaction();
            throw new BusinessException(null, "generic.error", "FamilyBOImpl.Insert()", exception, familyTO);
      }
      finally
      {
              NHibernateUtil.CloseSession();

             scope.Complete();
      }

}


Somebody can help me?

thanks!!!!

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 8:42 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
When debugging, I saw that the attribute IsolationLevel of
System.Transactions.CommitableTransaction is Serializable.

the config of hibernate is:

Code:
<add key="hibernate.connection.isolation" value="ReadCommitted"/>


Can I configure the isolation leve of this?

_________________
Tads


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.