/** * Begins a transaction with the given isolation level. Every statement executed on the return {@link Connection} * instance, will be executed in the transaction. It is very important to always call either the {@link org.sql2o.Connection#commit()} * method or the {@link org.sql2o.Connection#rollback()} method to close the transaction. Use proper try-catch logic. * @param isolationLevel the isolation level of the transaction * @return the {@link Connection} instance to use to run statements in the transaction. */ public Connection beginTransaction(int isolationLevel){ return beginTransaction(getConnectionSource(), isolationLevel); }
Connection(Sql2o sql2o, ConnectionSource connectionSource, boolean autoClose) { this.connectionSource = connectionSource != null ? connectionSource : sql2o.getConnectionSource(); this.autoClose = autoClose; this.sql2o = sql2o; createConnection(); }
Connection(Sql2o sql2o, ConnectionSource connectionSource, boolean autoClose) { this.connectionSource = connectionSource != null ? connectionSource : sql2o.getConnectionSource(); this.autoClose = autoClose; this.sql2o = sql2o; createConnection(); }
Connection(Sql2o sql2o, ConnectionSource connectionSource, boolean autoClose) { this.connectionSource = connectionSource != null ? connectionSource : sql2o.getConnectionSource(); this.autoClose = autoClose; this.sql2o = sql2o; createConnection(); }
/** * Begins a transaction with the given isolation level. Every statement executed on the return {@link Connection} * instance, will be executed in the transaction. It is very important to always call either the {@link Connection#commit()} * method or the {@link Connection#rollback()} method to close the transaction. Use proper try-catch logic. * * @param isolationLevel the isolation level of the transaction * @return the {@link Connection} instance to use to run statements in the transaction. */ public Connection beginTransaction(int isolationLevel) { return beginTransaction(getConnectionSource(), isolationLevel); }
/** * Begins a transaction with the given isolation level. Every statement executed on the return {@link Connection} * instance, will be executed in the transaction. It is very important to always call either the {@link org.sql2o.Connection#commit()} * method or the {@link org.sql2o.Connection#rollback()} method to close the transaction. Use proper try-catch logic. * @param isolationLevel the isolation level of the transaction * @return the {@link Connection} instance to use to run statements in the transaction. */ public Connection beginTransaction(int isolationLevel){ return beginTransaction(getConnectionSource(), isolationLevel); }