Class: Neo4j::Core::CypherSession::Transactions::Embedded
- Inherits:
-
Base
- Object
- Transaction::Base
- Base
- Neo4j::Core::CypherSession::Transactions::Embedded
- Defined in:
- lib/neo4j/core/cypher_session/transactions/embedded.rb
Instance Attribute Summary
Attributes inherited from Transaction::Base
Instance Method Summary collapse
- #commit ⇒ Object
- #delete ⇒ Object
-
#initialize(*args) ⇒ Embedded
constructor
A new instance of Embedded.
Methods inherited from Base
#after_commit, #after_commit_registry, #post_close!, #queries, #query
Methods inherited from Transaction::Base
#autoclosed!, #close, #closed?, #expired?, #failed?, #inspect, #mark_expired, #mark_failed, #root?
Constructor Details
#initialize(*args) ⇒ Embedded
Returns a new instance of Embedded.
8 9 10 11 |
# File 'lib/neo4j/core/cypher_session/transactions/embedded.rb', line 8 def initialize(*args) super @java_tx = adaptor.graph_db.begin_tx end |
Instance Method Details
#commit ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/neo4j/core/cypher_session/transactions/embedded.rb', line 13 def commit return if !@java_tx @java_tx.success @java_tx.close rescue Java::OrgNeo4jGraphdb::TransactionFailureException => e raise CypherError, e. end |
#delete ⇒ Object
22 23 24 25 26 27 |
# File 'lib/neo4j/core/cypher_session/transactions/embedded.rb', line 22 def delete return if !@java_tx @java_tx.failure @java_tx.close end |