/** * Builds a transaction object around a user provided connection. The returned transaction * allows the store to work against an externally managed transaction, such as in J2EE * enviroments. It is the duty of the caller to ensure the connection is to the same database * managed by this {@link JDBCDataStore}. * * <p>Calls to {@link Transaction#commit()}, {@link Transaction#rollback()} and {@link * Transaction#close()} will not result in corresponding calls to the provided {@link * Connection} object. * * @param conn The externally managed connection */ public Transaction buildTransaction(Connection cx) { DefaultTransaction tx = new DefaultTransaction(); State state = new JDBCTransactionState(cx, this, true); tx.putState(this, state); return tx; }
/** * Builds a transaction object around a user provided connection. The returned transaction * allows the store to work against an externally managed transaction, such as in J2EE * enviroments. It is the duty of the caller to ensure the connection is to the same database * managed by this {@link JDBCDataStore}. * * Calls to {@link Transaction#commit()}, {@link Transaction#rollback()} and * {@link Transaction#close()} will not result in corresponding calls to the provided * {@link Connection} object. * * @param conn * The externally managed connection */ public Transaction buildTransaction(Connection cx) { DefaultTransaction tx = new DefaultTransaction(); State state = new JDBCTransactionState(cx, this, true); tx.putState(this, state); return tx; }