Skip to content

Commit

Permalink
bug: transactions must correctly rollback in case of exception
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpoljak committed Jul 14, 2011
1 parent e6ba704 commit 23e6a55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/fluent-query/connection.rb
Expand Up @@ -256,7 +256,12 @@ def do(query)
public
def transaction(&block)
self.begin
block.call
begin
block.call
rescue ::Exception => e
self.rollback
raise e
end
self.commit
end

Expand Down

0 comments on commit 23e6a55

Please sign in to comment.