geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r749679 - /geronimo/server/trunk/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java
Date Tue, 03 Mar 2009 18:35:06 GMT
Author: gawor
Date: Tue Mar  3 18:35:06 2009
New Revision: 749679

URL: http://svn.apache.org/viewvc?rev=749679&view=rev
Log:
Do rollback in case of an exception. Based on patch from Ivan (GERONIMO-4544)

Modified:
    geronimo/server/trunk/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java

Modified: geronimo/server/trunk/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java?rev=749679&r1=749678&r2=749679&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java
(original)
+++ geronimo/server/trunk/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java
Tue Mar  3 18:35:06 2009
@@ -152,6 +152,13 @@
             conn.commit();
             portlet.addInfoMessage(request, portlet.getLocalizedString(request, "infoMsg03"));
             return true;
+        } catch (SQLException e) {
+            try {
+                conn.rollback();
+            } catch (Exception unHandledException) {
+            }
+            portlet.addErrorMessage(request, portlet.getLocalizedString(request, "errorMsg08"),
e.getMessage());
+            return false;
         } catch (Throwable e) {
             portlet.addErrorMessage(request, portlet.getLocalizedString(request, "errorMsg08"),
e.getMessage());
             return false;



Mime
View raw message