private void rollbackInternal() { rollback = prepareCommand("ROLLBACK", rollback); rollback.executeUpdate(); }
private int executeUpdateInternal() throws SQLException { closeOldResultSet(); synchronized (session) { try { setExecutingStatement(command); updateCount = command.executeUpdate(); } finally { setExecutingStatement(null); } } return updateCount; }
/** * Release this savepoint. This method only set the connection to null and * does not execute a statement. */ void release() { checkValid(); conn.prepareCommand( "RELEASE TO SAVEPOINT " + getName(name, savepointId), Integer.MAX_VALUE).executeUpdate(); this.conn = null; }
/** * Roll back to this savepoint. */ void rollback() { checkValid(); conn.prepareCommand( "ROLLBACK TO SAVEPOINT " + getName(name, savepointId), Integer.MAX_VALUE).executeUpdate(); }
/** * Commits the current transaction. This call has only an effect if auto * commit is switched off. * * @throws SQLException if the connection is closed */ @Override public synchronized void commit() throws SQLException { try { debugCodeCall("commit"); checkClosed(); try { commit = prepareCommand("COMMIT", commit); commit.executeUpdate(); } finally { afterWriting(); } } catch (Exception e) { throw logAndConvert(e); } }
/** * Creates a new unnamed savepoint. * * @return the new savepoint */ @Override public Savepoint setSavepoint() throws SQLException { try { int id = getNextId(TraceObject.SAVEPOINT); if (isDebugEnabled()) { debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint()"); } checkClosed(); CommandInterface set = prepareCommand( "SAVEPOINT " + JdbcSavepoint.getName(null, savepointId), Integer.MAX_VALUE); set.executeUpdate(); JdbcSavepoint savepoint = new JdbcSavepoint(this, savepointId, null, trace, id); savepointId++; return savepoint; } catch (Exception e) { throw logAndConvert(e); } }
private int executeUpdateInternal(String sql) throws SQLException { checkClosed(); try { closeOldResultSet(); sql = JdbcConnection.translateSQL(sql, escapeProcessing); CommandInterface command = conn.prepareCommand(sql, fetchSize); synchronized (session) { setExecutingStatement(command); try { updateCount = command.executeUpdate(); } finally { setExecutingStatement(null); } } command.close(); return updateCount; } finally { afterWriting(); } }
/** * Creates a new named savepoint. * * @param name the savepoint name * @return the new savepoint */ @Override public Savepoint setSavepoint(String name) throws SQLException { try { int id = getNextId(TraceObject.SAVEPOINT); if (isDebugEnabled()) { debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint(" + quote(name) + ")"); } checkClosed(); CommandInterface set = prepareCommand("SAVEPOINT " + JdbcSavepoint.getName(name, 0), Integer.MAX_VALUE); set.executeUpdate(); JdbcSavepoint savepoint = new JdbcSavepoint(this, 0, name, trace, id); return savepoint; } catch (Exception e) { throw logAndConvert(e); } }
} else { returnsResultSet = false; updateCount = command.executeUpdate();
} else { returnsResultSet = false; updateCount = command.executeUpdate();