Title: [799] trunk/activerecord-jdbc/src/java/jdbc_adapter/ JdbcAdapterInternalService.java: Clean up connection exception logic a bit
Revision
799
Author
nicksieger
Date
2007-11-13 16:45:09 -0500 (Tue, 13 Nov 2007)

Log Message

Clean up connection exception logic a bit

Modified Paths


Diff

Modified: trunk/activerecord-jdbc/src/java/jdbc_adapter/JdbcAdapterInternalService.java (798 => 799)


--- trunk/activerecord-jdbc/src/java/jdbc_adapter/JdbcAdapterInternalService.java	2007-11-13 21:34:22 UTC (rev 798)
+++ trunk/activerecord-jdbc/src/java/jdbc_adapter/JdbcAdapterInternalService.java	2007-11-13 21:45:09 UTC (rev 799)
@@ -251,9 +251,9 @@
             try {
                 return block.call(c);
             } catch (Exception e) {
-                Throwable root = e;
-                while (root.getCause() != null && root.getCause() != root) {
-                    root = root.getCause();
+                toWrap = e;
+                while (toWrap.getCause() != null && toWrap.getCause() != toWrap) {
+                    toWrap = toWrap.getCause();
                 }
                 if (i == 0) {
                     tries = (int) config_value(recv, "retry_count").convertToInteger().getLongValue();
@@ -262,11 +262,10 @@
                     }
                 }
                 i++;
-                toWrap = e;
                 if (isConnectionBroken(recv, c)) {
                     reconnect(recv);
                 } else {
-                    throw wrap(recv, e);
+                    throw wrap(recv, toWrap);
                 }
             }
         }
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to