$transaction->isError()
and$transaction->isClosed
を neo4j トランザクションで使用しようとしましたが、これらの関数はエラーをキャッチできませんでした。
以下は、コミット後にトランザクションのロールバックを行ったコードです。ドキュメントによると、エラーが発生し、によって処理されるはずですが、エラーをisClosed()
処理せず、エラーが発生しました。
コード
require("vendor/autoload.php");
use Everyman\Neo4j\Cypher\Query;
$client = new Everyman\Neo4j\Client();
$transaction = $client->beginTransaction();
$queryA = new Query($client, 'CREATE (n:testing{id:189})');
$result = $transaction->addStatements($queryA);
$transaction->commit();
$transaction->rollback(); // performing rollback after commit
if ($transaction->isClosed()) {
echo "No more statements can be added!";
}
エラー
Fatal error: Uncaught exception 'Everyman\Neo4j\Exception' with message 'Transaction is already closed' in C:\xampp\htdocs\feed\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Transaction.php on line 149
しかし、実際には、このエラーは によって処理されるべきですが、処理されません$transaction->isClosed()
でした
助けてください、事前に感謝します