Exemplo n.º 1
0
 /**
  * Rolls back the current transaction. This call has only an effect if auto commit is switched
  * off.
  *
  * @throws SQLException if the connection is closed
  */
 public synchronized void rollback() throws SQLException {
   try {
     debugCodeCall("rollback");
     checkClosedForWrite();
     try {
       rollbackInternal();
     } finally {
       afterWriting();
     }
   } catch (Exception e) {
     throw logAndConvert(e);
   }
 }
Exemplo n.º 2
0
 // ## Java 1.4 begin ##
 public void rollback(Savepoint savepoint) throws SQLException {
   try {
     JdbcSavepoint sp = convertSavepoint(savepoint);
     debugCode("rollback(" + sp.getTraceObjectName() + ");");
     checkClosedForWrite();
     try {
       sp.rollback();
     } finally {
       afterWriting();
     }
   } catch (Exception e) {
     throw logAndConvert(e);
   }
 }
Exemplo n.º 3
0
 /**
  * Commits the current transaction. This call has only an effect if auto commit is switched off.
  *
  * @throws SQLException if the connection is closed
  */
 public synchronized void commit() throws SQLException {
   try {
     debugCodeCall("commit");
     checkClosedForWrite();
     try {
       commit = prepareCommand("COMMIT", commit);
       commit.executeUpdate();
     } finally {
       afterWriting();
     }
   } catch (Exception e) {
     throw logAndConvert(e);
   }
 }
Exemplo n.º 4
0
 // ## Java 1.6 begin ##
 public NClob createNClob() throws SQLException {
   try {
     int id = getNextId(TraceObject.CLOB);
     debugCodeAssign("NClob", TraceObject.CLOB, id, "createNClob()");
     checkClosedForWrite();
     try {
       Value v =
           session
               .getDataHandler()
               .getLobStorage()
               .createClob(new InputStreamReader(new ByteArrayInputStream(Utils.EMPTY_BYTES)), 0);
       return new JdbcClob(this, v, id);
     } finally {
       afterWriting();
     }
   } catch (Exception e) {
     throw logAndConvert(e);
   }
 }