Pop the next transaction from the transaction queue

@return TransactionInterface|null
333158
public function nextPending()
    {
        if (!$this->hasPending()) {
            return null;
        }

        $current = $this->pending->current();
        $this->pending->next();

        return $current;
    }
227720
private static function _stop()
  {
    $adapter = self::$_transaction->_stored;
    
    if (is_null($adapter)) {
      Config::clearDataAdapter();
    } else {
      Config::setDataAdapter($adapter);
    }
  }
1190088
public function pop($queue = null)
    {
        $queue = $queue ?: $this->queue;

        $result = $this->client->reserveMessage($queue);

        if (!$result) {
            return null;
        }

        $message = new QueueMessage();

        $message->setId($result->id);
        $message->setAttempts($result->reserved_count);
        $message->setBody(json_decode($result->body, true));
        $message->setRawBody($result->body);
        $message->setQueueName($queue ?: $this->queue);
        $message->set('reservation_id', $result->reservation_id);

        return $message;
    }
1318032
private function setupCommit()
    {
        $obj_commit_request = new CommitRequest();
        if(null === $this->str_next_transaction) {
            $obj_commit_request->setMode(Mode::NON_TRANSACTIONAL);
        } else {
            $obj_commit_request->setMode(Mode::TRANSACTIONAL);
            $this->applyTransaction($obj_commit_request);
        }
        return $obj_commit_request;
    }
704806
public static function popRequest()
    {
        $removed = array_pop(static::$_requests);
        $last = end(static::$_requests);
        if ($last) {
            static::setRequestContext($last);
            reset(static::$_requests);
        }

        return $removed;
    }
806471
public function commit(): Promise
    {
        if ($this->handle === null) {
            throw new TransactionError("The transaction has been committed or rolled back");
        }

        $promise = $this->handle->query("COMMIT");
        $this->handle = null;
        $promise->onResolve($this->release);

        return $promise;
    }
961170
public function pop($queueName = '')
    {

        if (!isset($this->queues[$queueName])) {
            return null;
        }

        if (!$this->queues[$queueName]) {
            return null;
        }

        return array_pop($this->queues[$queueName]);
    }
824797
public function rollback()
    {
        if ($this->signalDispatcher instanceof TransactionHandler) {
            $this->signalDispatcher->rollback();
        }

        return $this->repository->rollback();
    }
1255771
protected function NextItem()
	{
		while (true)
		{
			if ( ! $this->accept)
			{
				if ( ! $this->MoveNextIter() )
					return null;
				$this->nav = $this->curr->CloneInstance();
				$this->curr->MoveToRoot();
			}
			$this->accept = $this->curr->MoveToFollowing( $this->kind, $this->nav );
			if ( $this->accept )
			{
				if ( $this->curr->isNodeAncestorOf( $this->nav ) ) continue;

				if ( $this->TestItem() )
				{
					$this->sequentialPosition++;
					return $this->curr;
				}
			}
		}
	}
1112294
public function pop()
    {
        if (count($this->_heap) == 0) {
            return null;
        }

        $top = $this->_heap[0];
        $lastId = count($this->_heap) - 1;

        /**
         * Find appropriate position for last node
         */
        $nodeId  = 0;     // Start from a top
        $childId = 1;     // First child

        // Choose smaller child
        if ($lastId > 2  &&  $this->_less($this->_heap[2], $this->_heap[1])) {
            $childId = 2;
        }

        while ($childId < $lastId  &&
               $this->_less($this->_heap[$childId], $this->_heap[$lastId])
          ) {
            // Move child node up
            $this->_heap[$nodeId] = $this->_heap[$childId];

            $nodeId  = $childId;               // Go down
            $childId = ($nodeId << 1) + 1;     // First child

            // Choose smaller child
            if (($childId+1) < $lastId  
                && $this->_less($this->_heap[$childId+1], $this->_heap[$childId])
            ) {
                $childId++;
            }
        }

        // Move last element to the new position
        $this->_heap[$nodeId] = $this->_heap[$lastId];
        unset($this->_heap[$lastId]);

        return $top;
    }
507645
public function getTransactional() {
		if ($this->transactionalEm !== null && $this->transactionalEm->isOpen()) {
			return $this->transactionalEm;
		}
		
		$pdo = $this->pdoPool->getPdo($this->persistenceUnitName);
		if (!$pdo->inTransaction()) {
			throw new IllegalStateException('No tranaction open.');
		}
		
		$this->transactionalEm = new LazyEntityManager($this->persistenceUnitName, $this->pdoPool, true);
		$this->transactionalEm->bindPdo($pdo);
	
		return $this->transactionalEm;
	}
670492
public function commit()
    {
        if (!$this->isTransaction()) {
            throw new PDOException('There is no active transaction');
        }
        $ret = $this->pool->commit($this->_bingId);
        $this->_bingId = null;
        $this->_isTransaction = false;
        return $ret;
    }
21779
public function pop($queue = null)
	{
		$queue = $this->getQueue($queue);

		$this->database->beginTransaction();

		if ($job = $this->getNextAvailableJob($queue)) {
			$job = $this->markJobAsReserved($job);

			$this->database->commit();

			return new DatabaseJob(
				$this->container, $this, $job, $queue
			);
		}

		$this->database->commit();
	}
1308747
public function truncate() {
		//connect to database
		$this->mapper->connect();
	
		//begin transaction
		$this->mapper->beginTransaction();
	
		//build query
		$query = $this->mapper->newQuery()
		->deleteFrom($this->entityProfile->getEntityTable());
			
		//run query
		$result = $query->exec();
	
		//commit
		$this->mapper->commit();
		return $result;
	}
532090
public function moveNext()
    {
        $this->peek = 0;
        $this->token = $this->next;
        $this->next = isset($this->tokens[++$this->i]) ? $this->tokens[$this->i] : null;

        return null !== $this->next;
    }
62900
public function commit()
    {
        $return = $this->repository->commit();

        if ($this->signalDispatcher instanceof TransactionHandler) {
            $this->signalDispatcher->commit();
        }

        return $return;
    }
790210
protected function transactionStart() {
		if ( $this->transactionCounter == 0 ) {
			$this->transactionCounter++;
			return $this->dbh->beginTransaction();
		}
		$this->transactionCounter++;
		return $this->transactionCounter >= 0;
	}