public synchronized void rollback(Savepoint savepoint)
throws SQLException {
String msg;
jdbcSavepoint sp;
Result req;
checkClosed();
if (savepoint == null) {
msg = "savepoint is null";
throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
}
try {
if (sessionProxy.isAutoCommit()) {
msg = "connection is autocommit";
throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
}
} catch (HsqlException e) {
throw Util.sqlException(e);
}
// fredt - might someone call this with a Savepoint from a different driver???
if (!(savepoint instanceof jdbcSavepoint)) {
throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
}
sp = (jdbcSavepoint) savepoint;
if (this != sp.connection) {
msg = savepoint + " was not issued on this connection";
throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
}
req = Result.newRollbackToSavepointRequest(sp.name);
try {
Result result = sessionProxy.execute(req);
if (result.isError()) {
Util.throwError(result);
}
} catch (HsqlException e) {
Util.throwError(e);
}