-->
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: JDBCContext does not see in progress JTA transaction
PostPosted: Fri Aug 11, 2006 11:36 am 
Beginner
Beginner

Joined: Fri Aug 27, 2004 1:59 pm
Posts: 33
I am finding that when JDBCContext.isTransactionInProgress is invoked that it does detect the current JTA transaction.

In the method below, 'hibernateTransaction' is always null. The only place in this class where 'hibernateTransaction' is set to a non-null value is in getTransaction().

Code:
    public boolean isTransactionInProgress() {
        return owner.getFactory().getSettings().getTransactionFactory()
                .isTransactionInProgress( this, owner, hibernateTransaction) );
    }


There are lots of places in hibernate where JDBCContext.getTransaction is invoked, but not my program prior to the call to isTransactionInProgress.

If I change isTransactionInProgress to use getTransaction instead of using the local hibernateTransaction then all is fine.

Code:
    public boolean isTransactionInProgress() {
        return owner.getFactory().getSettings().getTransactionFactory()
                .isTransactionInProgress( this, owner, getTransaction() );
    }


Is there any reason why this should not be the implementation fo this method?

Hibernate version:

hibernate 3.2CR2
entity-manager 3.2CR1
annotations 3.2CR1

Name and version of the database you are using:

geronimo JTA transaction manager
sybase or mysql

_________________
-barry
---------------------
polly want-a point?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 11, 2006 1:57 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you must joinTransaction() if your container is not JavaEE compatible

_________________
Emmanuel


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.