/** @return void */
public function commit()
{
if (self::$transactionCounter[$dsn = $this->getDsnKey()] === 0) {
throw new Exception\InvalidStateException('No transaction started.');
}
if (--self::$transactionCounter[$dsn] === 0) {
$this->connection->commit();
}
}