sqlg3.runtime.Transaction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlg3-runtime Show documentation
Show all versions of sqlg3-runtime Show documentation
SQLG is a preprocessor and a library that uses code generation to simplify writing JDBC code
package sqlg3.runtime;
import sqlg3.core.IDBCommon;
import sqlg3.core.ITransaction;
import java.sql.SQLException;
public final class Transaction implements ITransaction {
private final TransactionContext transaction;
public Transaction(GlobalContext global, SessionContext session) {
this.transaction = new TransactionContext(global, session);
}
@Override
public T getInterface(Class iface) {
return transaction.getInterface(iface, false, true);
}
@Override
public void commit() throws SQLException {
transaction.commit();
}
@Override
public void rollback() throws SQLException {
transaction.rollback();
}
}