Class: Neo4j::TransactionManagement

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/transaction_management.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ TransactionManagement

Returns a new instance of TransactionManagement.



2
3
4
# File 'lib/neo4j/transaction_management.rb', line 2

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/neo4j/transaction_management.rb', line 6

def call(env)
  Neo4j::Transaction.new
  @app.call(env)
rescue
  Neo4j::Transaction.failure
  raise
ensure
  Neo4j::Transaction.finish
end