public void begin(boolean readOnly) throws DriverException {
this.readOnly = readOnly;
// Acquire a connection from the pool
try {
if (currentConnection != null) {
throw new DriverException(I18N.msg("E_txn_in_use"), lastBegin);
}
currentConnection = dataSource.getConnection();
currentConnection.setAutoCommit(readOnly);
currentConnection.setReadOnly(readOnly);
// Populate lastBegin
try {
throw new Exception();
} catch (Exception e) {
lastBegin = e;
}
} catch (SQLException e) {
throw new DriverException(e);
}
}