return managedConnection == null;
}
public Transaction currentTransaction() {
if (managedConnection == null) {
throw new JDOException(NO_ACTIVE_CONNECTION);
}
//if transaction mode is not normal, return this
if (connectionFactory.getTransactionMode() != SpeedoProperties.TRANSACTION_BMODE_NORMAL) {
if(connectionFactory.getTransactionMode() == SpeedoProperties.TRANSACTION_BMODE_UT) {
try {
if (userTransaction == null) {
Context ic = new InitialContext();
userTransaction = (UserTransaction) ic.lookup("javax.transaction.UserTransaction");
}
logger.log(BasicLevel.DEBUG, "UserTransaction is used.");
} catch (Exception e) {
throw new JDOException("Error with JTA UserTransaction", e);
}
}
return this;
} else {
return ((JDOPOManagerItf) managedConnection.getPOManager()).currentTransaction();