Neo4j::Bolt::Txn - Container for a Neo4j Bolt explicit transaction
use Neo4j::Bolt; $cxn = Neo4j::Bolt->connect("bolt://localhost:7687"); unless ($cxn->connected) { print STDERR "Problem connecting: ".$cxn->errmsg; } $txn = Neo4j::Bolt::Txn->new($cxn); $stream = $txn->run_query( "CREATE (a:booga {this:'that'}) RETURN a;" ); if ($stream->failure) { print STDERR "Problem with query run: ". ($stream->client_errmsg || $stream->server_errmsg); $txn->rollback; } else { $txn->commit; }
Neo4j::Bolt::Txn is a container for a Bolt explicit transaction, a feature available in Bolt versions 3.0 and greater.
Create (begin) a new transaction. Execute within the transaction with run_query(), send_query(), do_query().
Commit the changes staged by execution in the transaction.
Rollback all changes.
Completely analogous to same functions in Neo4j::Bolt::Cxn.
Mark A. Jensen CPAN: MAJENSEN majensen -at- cpan -dot- org
This software is Copyright (c) 2019-2021 by Mark A. Jensen.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install Neo4j::Bolt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Neo4j::Bolt
CPAN shell
perl -MCPAN -e shell install Neo4j::Bolt
For more information on module installation, please visit the detailed CPAN module installation guide.