} else if (suspendInJTA()) { try { TransactionManager tm = getConfiguration()
/** * Return the connection to use based on the type of sequence. This * connection will automatically be closed; do not close it. */ protected Connection getConnection(JDBCStore store) throws SQLException { if (type == TYPE_TRANSACTIONAL || type == TYPE_CONTIGUOUS) return store.getConnection(); else if (suspendInJTA()) { try { TransactionManager tm = getConfiguration() .getManagedRuntimeInstance().getTransactionManager(); _outerTransaction.set(tm.suspend()); tm.begin(); return store.getConnection(); } catch (Exception e) { throw new StoreException(e); } } else { JDBCConfiguration conf = store.getConfiguration(); DataSource ds = conf.getDataSource2(store.getContext()); Connection conn = ds.getConnection(); if (conn.getAutoCommit()) conn.setAutoCommit(false); return conn; } }