[英]Neo4j, graphaware: After catching an exception, another query will not execute.
我以正常方式連接到neo4j,我可以運行查詢沒有問題。
在測試期間,我編寫了一個應該失敗的查詢(由於唯一性約束),該查詢確實按預期失敗,並且我捕獲了異常。
問題是當我嘗試執行隊列中的下一個查詢時,它只是掛起(比超時時間長)。
我不認為這是正常行為。
try{
$result = $neo->run ($query);
}
catch (Exception $e) {
// handle it
}
// all good so far
// now we attempt:
try{
$result = $neo->run ($next_query);
}
catch (Exception $e) {
// handle it
}
// hangs longer than timeout
如果我從隊列中刪除失敗的查詢,則一切完成
因此,似乎php-client拋出的異常中斷了與neo4j的連接。
如果我將代碼修改為以下內容,則一切正常。
try{
$result = $neo->run ($query);
}
catch (Exception $e) {
// handle it
connect_to_neo()
}
// all good so far
try{
$result = $neo->run ($next_query);
}
catch (Exception $e) {
// handle it
}
// all good, $next_query gets executed
我認為中斷連接的異常不是所需的行為。 將在github上提出問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.