neoxygen / neo4j-neoclient

Simple PHP HttpClient for the Neo4j ReST API with Multi DB Support
MIT License
121 stars 138 forks source link

add a prepareTransaction method #26

Closed ikwattro closed 9 years ago

ikwattro commented 9 years ago

Currently, there is two possibility to send multiple statements in one transaction :

The first one is good if you want to be able to manage the same transaction between different runtimes (which is a rare use cas)

The second I find it not really handy.

The approach is to have the following :

$tx = $client->prepareTransaction($conn = null);
$tx->addQuery($q, $p);
$tx->addQuery($q, $p);
$tx->commit();

using the Cypher transactional http endpoint /transaction/commit

there would be no http requests until commit is triggered.