Module: Neo4j::Transaction::Instance

Included in:
Embedded::EmbeddedTransaction, Server::CypherTransaction
Defined in:
lib/neo4j/transaction.rb

Instance Method Summary collapse

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.

Parameters:

Returns:

  • (Java::OrgNeo4jKernelImplCoreapi::PropertyContainerLocker)


59
60
# File 'lib/neo4j/transaction.rb', line 59

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.

Parameters:

Returns:

  • (Java::OrgNeo4jKernelImplCoreapi::PropertyContainerLocker)


67
68
# File 'lib/neo4j/transaction.rb', line 67

def acquire_write_lock(entity)
end

#autoclosed!Object



24
25
26
# File 'lib/neo4j/transaction.rb', line 24

def autoclosed!
  @autoclosed = true if transient_failures_autoclose?
end

#autoclosed?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/neo4j/transaction.rb', line 32

def autoclosed?
  !!@autoclosed
end

#closeObject

Commits or marks this transaction for rollback, depending on whether failure() has been previously invoked.



71
72
73
74
75
76
77
# File 'lib/neo4j/transaction.rb', line 71

def close
  pop_nested!
  return if @pushed_nested >= 0
  fail "Can't commit transaction, already committed" if @pushed_nested < -1
  Neo4j::Transaction.unregister(self)
  post_close!
end

#expired?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/neo4j/transaction.rb', line 40

def expired?
  !!@expired
end

#failed?Boolean Also known as: failure?

If it has been marked as failed. Aliased for legacy purposes.

Returns:

  • (Boolean)


19
20
21
# File 'lib/neo4j/transaction.rb', line 19

def failed?
  !!@failure
end

#mark_expiredObject



36
37
38
# File 'lib/neo4j/transaction.rb', line 36

def mark_expired
  @expired = true
end

#mark_failedObject Also known as: failure

Marks this transaction as failed, which means that it will unconditionally be rolled back when close() is called. Aliased for legacy purposes.



13
14
15
# File 'lib/neo4j/transaction.rb', line 13

def mark_failed
  @failure = true
end

#pop_nested!Object



50
51
52
# File 'lib/neo4j/transaction.rb', line 50

def pop_nested!
  @pushed_nested -= 1
end

#push_nested!Object



45
46
47
# File 'lib/neo4j/transaction.rb', line 45

def push_nested!
  @pushed_nested += 1
end

#register_instanceObject



7
8
9
10
# File 'lib/neo4j/transaction.rb', line 7

def register_instance
  @pushed_nested = 0
  Neo4j::Transaction.register(self)
end

#transient_failures_autoclose?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/neo4j/transaction.rb', line 28

def transient_failures_autoclose?
  Neo4j::Session.current.version >= '2.2.6'
end