Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
klobuczek committed Dec 19, 2018
1 parent 018a29d commit ef61932
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/neo4j/core/cypher_session/transactions/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ class Driver < Base
attr_reader :driver_tx, :driver_session

def initialize(*args)
begin
super
return unless root?
@driver_session = session.adaptor.driver.session(Neo4j::Driver::AccessMode::WRITE)
@driver_tx = @driver_session.begin_transaction
rescue => e
clean_transaction_registry
@driver_tx.close if @driver_tx
@driver_session.close if @driver_session
raise e
end
super
return unless root?
@driver_session = session.adaptor.driver.session(Neo4j::Driver::AccessMode::WRITE)
@driver_tx = @driver_session.begin_transaction
rescue StandardError => e
clean_transaction_registry
@driver_tx.close if @driver_tx
@driver_session.close if @driver_session
raise e
end

def commit
Expand Down

0 comments on commit ef61932

Please sign in to comment.