<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -19,6 +19,7 @@ module DBI
     # since we need to thread protect the AutoCommit property of the
     # database handle.
     def one_transaction
+      exception = nil
       @mutex.synchronize do
         # Keep track of transactions for debugging purposes
         trans = { :time =&gt; ::Time.now, :stack =&gt; caller }
@@ -26,14 +27,22 @@ module DBI
 
         auto_commit = self[ 'AutoCommit' ]
         self[ 'AutoCommit' ] = false
-        result = transaction do
-          yield self
+        result = nil
+        begin
+          result = transaction do
+            yield self
+          end
+        rescue Exception =&gt; e
+          exception = e
         end
         self[ 'AutoCommit' ] = auto_commit
 
         @transactions.delete trans
         result
       end
+      if exception
+        raise exception
+      end
     end
 
     def select_column( statement, *bindvars )</diff>
      <filename>lib/m4dbi/database-handle.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6c228a7b4ee29efe09df5d8e6c03a6224aadd9d3</id>
    </parent>
  </parents>
  <author>
    <name>Pistos</name>
    <email>gitsomegrace.5.pistos@geoshell.com</email>
  </author>
  <url>http://github.com/Pistos/m4dbi/commit/59c44877e90696a9f808cc2b730c5d0dae3a76a4</url>
  <id>59c44877e90696a9f808cc2b730c5d0dae3a76a4</id>
  <committed-date>2009-07-16T21:44:19-07:00</committed-date>
  <authored-date>2009-07-16T21:44:19-07:00</authored-date>
  <message>In one_transaction, handle exceptions in the transaction.
Make sure exceptions don't get in the way of properly cleaning up.</message>
  <tree>ed00b9786c744c51d7da81ae4cb95a3bcc13b29b</tree>
  <committer>
    <name>Pistos</name>
    <email>gitsomegrace.5.pistos@geoshell.com</email>
  </committer>
</commit>
