Skip to content

Commit 6788d0f

Browse files
committed
inject database when opening a transaction
1 parent 51d270e commit 6788d0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Network/Bolt/BoltSession.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public function openTransaction(iterable $statements = null): TransactionInterfa
9292
$sock = new StreamSocket($this->parsedUrl['host'], $this->parsedUrl['port'] ?? self::DEFAULT_TCP_PORT);
9393
$bolt = new Bolt($sock);
9494
$bolt->init($userAgent, $this->parsedUrl['user'], $this->parsedUrl['pass']);
95-
if (!$bolt->begin()) {
95+
$extra = ['db' => $this->injections->database()];
96+
if (!$bolt->begin($extra)) {
9697
throw new Neo4jException(new Vector([new Neo4jError('', 'Cannot open new transaction')]));
9798
}
9899
} catch (Exception $e) {

0 commit comments

Comments
 (0)