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)


48
49
# File 'lib/neo4j/transaction.rb', line 48

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)


56
57
# File 'lib/neo4j/transaction.rb', line 56

def acquire_write_lock(entity)
end

#closeObject

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



60
61
62
63
64
65
66
# File 'lib/neo4j/transaction.rb', line 60

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

#expired?Boolean

Returns:

  • (Boolean)


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

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 Also known as: expired



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

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



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

def pop_nested!
  @pushed_nested -= 1
end

#push_nested!Object



34
35
36
# File 'lib/neo4j/transaction.rb', line 34

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