Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.
977148
@Override
    public void rollback() throws SQLException
    {
        checkClosed();
        if (props.getProperty(ROLLBACK_THROW_EXCEPTION, "true").equalsIgnoreCase("true")) {
            throw SQLError.noSupport();
        }
    }
203931
public void destroy()
    {
        removeAllListeners();
        if (connectionManager != null)
        {
            if(connectionManager.isInLocalTransaction())
            {
                connectionManager.localRollback();
            }
            connectionManager.releaseConnection();
        }
        this.setClosed(true);

        this.descriptorRepository = null;
        this.pbKey = null;
        this.pbf = null;
        this.connectionManager = null;
        this.dbAccess = null;
        this.objectCache = null;
        this.sequenceManager = null;
        this.sqlGenerator = null;
        this.statementManager = null;
    }
1076731
function _close()
	{
		if (!$this->_connectionID) {
			return;
		}


		if (!$this->autoCommit) {
			oci_rollback($this->_connectionID);
		}
		if (count($this->_refLOBs) > 0) {
			foreach ($this ->_refLOBs as $key => $value) {
				$this->_refLOBs[$key]['LOB']->free();
				unset($this->_refLOBs[$key]);
			}
		}
		oci_close($this->_connectionID);

		$this->_stmt = false;
		$this->_connectionID = false;
	}
1254306
def clear(self):
        
        self.database.delete(self.key)
        self.database.delete(self.event)
525449
def reset(self):
        
        self._request = None
        self._response = None
        self._transaction_id = uuid.uuid4().hex
107585
@Override
    public void delete(IEntityLock lock) throws LockingException {
        Connection conn = null;
        try {
            conn = RDBMServices.getConnection();
            primDelete(lock, conn);
        } catch (SQLException sqle) {
            throw new LockingException("Problem deleting " + lock, sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }
    }
100629
void abort() throws SQLException {
        if (mRegisteredLobs != null) {
            for (JDBCLob lob : mRegisteredLobs) {
                lob.close();
            }
            mRegisteredLobs = null;
        }

        if (mIsNested) {
            if (mReady) {
                if (mSavepoint != null) {
                    mConnection.rollback(mSavepoint);
                    mSavepoint = null;
                }
                mReady = false;
            }

            if (mOriginalLevel != LEVEL_NOT_CHANGED) {
                if (mOriginalLevel == Connection.TRANSACTION_NONE) {
                    mConnection.setAutoCommit(true);
                } else {
                    mConnection.setTransactionIsolation(mOriginalLevel);
                }
            }

        } else {
            if (mReady) {
                mConnection.rollback();
                mReady = false;
            }
        }
    }
415272
protected function resetTransactionNesting()
    {
        // Check whether to use a connector's built-in transaction methods
        if ($this->connector instanceof TransactionalDBConnector) {
            if ($this->transactionNesting > 0) {
                $this->connector->transactionRollback();
            }
        }
        $this->transactionNesting = 0;
    }
133532
public function rollbackTransaction()
    {
        if (!self::$transaction) {
            throw new TransactionException("There is no Active Transaction");
        }

        self::$transaction = false;
        foreach (self::$connectionList as $dbDriver) {
            $dbDriver->rollbackTransaction();
        }
    }
1263307
public void close() throws SQLException {
		try {

			if (this.resetConnectionOnClose /*FIXME: && !getAutoCommit() && !isTxResolved() */){
				/*if (this.autoCommitStackTrace != null){
						logger.debug(this.autoCommitStackTrace);
						this.autoCommitStackTrace = null; 
					} else {
						logger.debug(DISABLED_AUTO_COMMIT_WARNING);
					}*/
				rollback();
				if (!getAutoCommit()){
					setAutoCommit(true);
				}
			}

			if (this.logicallyClosed.compareAndSet(false, true)) {


				if (this.threadWatch != null){
					this.threadWatch.interrupt(); // if we returned the connection to the pool, terminate thread watch thread if it's
					// running even if thread is still alive (eg thread has been recycled for use in some
					// container).
					this.threadWatch = null;
				}

				if (this.closeOpenStatements){
					for (Entry<Statement, String> statementEntry: this.trackedStatement.entrySet()){
						statementEntry.getKey().close();
						if (this.detectUnclosedStatements){
							logger.warn(String.format(UNCLOSED_LOG_ERROR_MESSAGE, statementEntry.getValue()));		
						}
					}
					this.trackedStatement.clear();
				} 

				if (!this.connectionTrackingDisabled){
					pool.getFinalizableRefs().remove(this.connection);
				}

				ConnectionHandle handle = null;

				//recreate can throw a SQLException in constructor on recreation
				try {
				    handle = this.recreateConnectionHandle();
				    this.pool.connectionStrategy.cleanupConnection(this, handle);
				    this.pool.releaseConnection(handle);				    
				} catch(SQLException e) {
				    //check if the connection was already closed by the recreation
				    if (!isClosed()) {
				    	this.pool.connectionStrategy.cleanupConnection(this, handle);
				    	this.pool.releaseConnection(this);
				    }
				    throw e;
				}
				
				
				if (this.doubleCloseCheck){
					this.doubleCloseException = this.pool.captureStackTrace(CLOSED_TWICE_EXCEPTION_MESSAGE);
				}
			} else {
				if (this.doubleCloseCheck && this.doubleCloseException != null){
					String currentLocation = this.pool.captureStackTrace("Last closed trace from thread ["+Thread.currentThread().getName()+"]:\n");
					logger.error(String.format(LOG_ERROR_MESSAGE, this.doubleCloseException, currentLocation));
				}
			}
		} catch (SQLException e) {
			throw markPossiblyBroken(e);
		}
	}
551949
void deleteAll() {
        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                sessionFactory.getCurrentSession().createQuery("DELETE FROM VersionInfo").executeUpdate();
            }
        });
    }
48818
public void clear() throws SQLException {
        clearStatements();
        statements.clear();
        parameterSets.clear();
        connections.clear();
        resultSets.clear();
        executeGroups.clear();
    }
299719
def rollback(self):
        
        if hasattr(self.local, 'tx') and self.local.tx:
            tx = self.local.tx.pop()
            tx.rollback()
            self._flush_tables()
1367035
protected function rollbackTransaction()
    {
        $this->entityManager->rollback();

        $connection = $this->entityManager->getConnection();
        if (!$connection->isTransactionActive() || $connection->isRollbackOnly()) {
            $this->entityManager->close();
        }
    }
495321
def close(self):
        
        super(LockingDatabase, self).close()
        if not self.readonly:
            self.release_lock()
205894
function () {
        // just to be sure! clear all items in the connections object. they should be cleared by now
        util.each(this.connections, function (value, prop, conns) {
            try {
                value.release();
            }
            catch (e) { } // nothing to do with error
            delete conns[prop];
        });

        // now execute end on the databases. will end pool if pool, or otherwise will execute whatever
        // `end` that has been exposed by db.js
        util.each(Transaction.databases, function (value, prop, databases) {
            value.end();
            databases[prop] = null;
        });
    }
1125963
private void upgradeLockIfNeeded()
    {
        // using clone to avoid ConcurentModificationException
        Iterator iter = ((List) mvOrderOfIds.clone()).iterator();
        TransactionImpl tx = getTransaction();
        ObjectEnvelope mod;
        while(iter.hasNext())
        {
            mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next());
            // ignore transient objects
            if(!mod.getModificationState().isTransient())
            {
                /*
                now we check if all modified objects has a write lock. On insert of new
                objects we don't need a write lock.
                */
                if(!mod.needsInsert())
                {
                    if((mod.needsDelete() || mod.needsUpdate()
                            || mod.hasChanged(tx.getBroker())))
                    {
                        needsCommit = true;
                        // mark object dirty
                        mod.setModificationState(mod.getModificationState().markDirty());
                        ClassDescriptor cld = mod.getClassDescriptor();
                        // if the object isn't already locked, we will do it now
                        if(!mod.isWriteLocked())
                        {
                            tx.doSingleLock(cld, mod.getObject(), mod.getIdentity(), Transaction.WRITE);
                        }
                    }
                }
                else
                {
                    needsCommit = true;
                }
            }
        }
    }