Skip to content

Commit d954a00

Browse files
committed
beginTransaction fix for result
1 parent db454a8 commit d954a00

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Session.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,16 @@ public function beginTransaction()
223223
'tx_settings' => $transaction_settings,
224224
]);
225225

226-
$tx_id = $result->getTxMeta()->getId();
227-
228-
$this->tx_id = $tx_id;
226+
if ($result && method_exists($result, 'getTxMeta'))
227+
{
228+
$this->tx_id = $result->getTxMeta()->getId();
229229

230-
return $tx_id;
230+
return $this->tx_id;
231+
}
232+
else
233+
{
234+
throw new Exception('YDB failed to begin transaction');
235+
}
231236
}
232237

233238
/**

0 commit comments

Comments
 (0)