Module: Neo4j::Transaction::Instance
- Included in:
- Embedded::EmbeddedTransaction, Server::CypherTransaction
- Defined in:
- lib/neo4j/transaction.rb
Instance Method Summary collapse
-
#acquire_read_lock(entity) ⇒ Java::OrgNeo4jKernelImplCoreapi::PropertyContainerLocker
Only for the embedded neo4j ! Acquires a read lock for entity for this transaction.
-
#acquire_write_lock(entity) ⇒ Java::OrgNeo4jKernelImplCoreapi::PropertyContainerLocker
Only for the embedded neo4j ! Acquires a write lock for entity for this transaction.
-
#close ⇒ Object
Commits or marks this transaction for rollback, depending on whether failure() has been previously invoked.
-
#failure ⇒ Object
(also: #fail)
Marks this transaction as failed, which means that it will unconditionally be rolled back when close() is called.
-
#failure? ⇒ Boolean
If it has been marked as failed.
- #pop_nested! ⇒ Object
- #push_nested! ⇒ Object
- #register_instance ⇒ Object
Instance Method Details
#acquire_read_lock(entity) ⇒ Java::OrgNeo4jKernelImplCoreapi::PropertyContainerLocker
Only for the embedded neo4j ! Acquires a read lock for entity for this transaction. See neo4j java docs.
39 40 |
# File 'lib/neo4j/transaction.rb', line 39 def acquire_read_lock(entity) end |
#acquire_write_lock(entity) ⇒ Java::OrgNeo4jKernelImplCoreapi::PropertyContainerLocker
Only for the embedded neo4j ! Acquires a write lock for entity for this transaction. See neo4j java docs.
47 48 |
# File 'lib/neo4j/transaction.rb', line 47 def acquire_write_lock(entity) end |
#close ⇒ Object
Commits or marks this transaction for rollback, depending on whether failure() has been previously invoked.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/neo4j/transaction.rb', line 51 def close pop_nested! return if @pushed_nested >= 0 raise "Can't commit transaction, already committed" if (@pushed_nested < -1) Neo4j::Transaction.unregister(self) if failure? _delete_tx else _commit_tx end end |
#failure ⇒ Object Also known as: fail
Marks this transaction as failed, which means that it will unconditionally be rolled back when close() is called.
14 15 16 |
# File 'lib/neo4j/transaction.rb', line 14 def failure @failure = true end |
#failure? ⇒ Boolean
If it has been marked as failed
20 21 22 |
# File 'lib/neo4j/transaction.rb', line 20 def failure? !!@failure end |
#pop_nested! ⇒ Object
30 31 32 |
# File 'lib/neo4j/transaction.rb', line 30 def pop_nested! @pushed_nested -= 1 end |
#push_nested! ⇒ Object
25 26 27 |
# File 'lib/neo4j/transaction.rb', line 25 def push_nested! @pushed_nested += 1 end |
#register_instance ⇒ Object
8 9 10 11 |
# File 'lib/neo4j/transaction.rb', line 8 def register_instance @pushed_nested = 0 Neo4j::Transaction.register(self) end |