diff --git a/lib/lucene/index.rb b/lib/lucene/index.rb index dcd639a3d..5cf12ab34 100644 --- a/lib/lucene/index.rb +++ b/lib/lucene/index.rb @@ -188,7 +188,7 @@ def commit rescue => ex $LUCENE_LOGGER.error(ex) # ex.backtrace.each{|x| $LUCENE_LOGGER.error(x)} - raise ex + raise end diff --git a/lib/lucene/transaction.rb b/lib/lucene/transaction.rb index a3c4b5f43..c3decfa01 100644 --- a/lib/lucene/transaction.rb +++ b/lib/lucene/transaction.rb @@ -97,7 +97,7 @@ def run # TODO reuse of error handling and logging $LUCENE_LOGGER.error{"Got exception #{ex}"} ex.backtrace.each {|t| $LUCENE_LOGGER.error(t)} - raise ex + raise ensure tx.commit unless tx.rollback? end diff --git a/lib/neo4j/transaction.rb b/lib/neo4j/transaction.rb index 5d7666ca9..d8463a5fd 100644 --- a/lib/neo4j/transaction.rb +++ b/lib/neo4j/transaction.rb @@ -106,7 +106,7 @@ def run # :yield: block of code to run inside a transaction rescue Exception => e #$NEO_LOGGER.warn{e.backtrace.join("\n")} tx.failure - raise e + raise ensure tx.finish end