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