/** * Undoes all changes made after the given <code>Savepoint</code> object * was set. * <P> * This method should be used only when auto-commit has been disabled. * * @param savepoint the <code>Savepoint</code> object to roll back to * @exception SQLException if a database access error occurs, * the <code>Savepoint</code> object is no longer valid, * or this <code>Connection</code> object is currently in * auto-commit mode * @see Savepoint * @see #rollback * @since 1.4 */ public void rollback(Savepoint savepoint) throws SQLException { checkClosed(); if (!haveMinimumServerVersion("8.0")) throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED); PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint; execSQLUpdate("ROLLBACK TO SAVEPOINT " + pgSavepoint.getPGName()); }
/** * Removes the given <code>Savepoint</code> object from the current * transaction. Any reference to the savepoint after it have been removed * will cause an <code>SQLException</code> to be thrown. * * @param savepoint the <code>Savepoint</code> object to be removed * @exception SQLException if a database access error occurs or * the given <code>Savepoint</code> object is not a valid * savepoint in the current transaction * @since 1.4 */ public void releaseSavepoint(Savepoint savepoint) throws SQLException { checkClosed(); if (!haveMinimumServerVersion("8.0")) throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED); PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint; execSQLUpdate("RELEASE SAVEPOINT " + pgSavepoint.getPGName()); pgSavepoint.invalidate(); }
/** * Undoes all changes made after the given <code>Savepoint</code> object * was set. * <P> * This method should be used only when auto-commit has been disabled. * * @param savepoint the <code>Savepoint</code> object to roll back to * @exception SQLException if a database access error occurs, * the <code>Savepoint</code> object is no longer valid, * or this <code>Connection</code> object is currently in * auto-commit mode * @see Savepoint * @see #rollback * @since 1.4 */ public void rollback(Savepoint savepoint) throws SQLException { if (!haveMinimumServerVersion("8.0")) throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED); PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint; execSQLUpdate("ROLLBACK TO SAVEPOINT " + pgSavepoint.getPGName()); }
/** * Removes the given <code>Savepoint</code> object from the current * transaction. Any reference to the savepoint after it have been removed * will cause an <code>SQLException</code> to be thrown. * * @param savepoint the <code>Savepoint</code> object to be removed * @exception SQLException if a database access error occurs or * the given <code>Savepoint</code> object is not a valid * savepoint in the current transaction * @since 1.4 */ public void releaseSavepoint(Savepoint savepoint) throws SQLException { if (!haveMinimumServerVersion("8.0")) throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED); PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint; execSQLUpdate("RELEASE SAVEPOINT " + pgSavepoint.getPGName()); pgSavepoint.invalidate(); }
/** * Undoes all changes made after the given <code>Savepoint</code> object * was set. * <P> * This method should be used only when auto-commit has been disabled. * * @param savepoint the <code>Savepoint</code> object to roll back to * @exception SQLException if a database access error occurs, * the <code>Savepoint</code> object is no longer valid, * or this <code>Connection</code> object is currently in * auto-commit mode * @see Savepoint * @see #rollback * @since 1.4 */ public void rollback(Savepoint savepoint) throws SQLException { checkClosed(); if (!haveMinimumServerVersion("8.0")) throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED); PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint; execSQLUpdate("ROLLBACK TO SAVEPOINT " + pgSavepoint.getPGName()); }
/** * Removes the given <code>Savepoint</code> object from the current * transaction. Any reference to the savepoint after it have been removed * will cause an <code>SQLException</code> to be thrown. * * @param savepoint the <code>Savepoint</code> object to be removed * @exception SQLException if a database access error occurs or * the given <code>Savepoint</code> object is not a valid * savepoint in the current transaction * @since 1.4 */ public void releaseSavepoint(Savepoint savepoint) throws SQLException { checkClosed(); if (!haveMinimumServerVersion("8.0")) throw new PSQLException(GT.tr("Server versions prior to 8.0 do not support savepoints."), PSQLState.NOT_IMPLEMENTED); PSQLSavepoint pgSavepoint = (PSQLSavepoint)savepoint; execSQLUpdate("RELEASE SAVEPOINT " + pgSavepoint.getPGName()); pgSavepoint.invalidate(); }