[PATCH] Fixed open cursor leaks in Oracle by closing all ResultSets and PreparedStatements

Michael Jaszczyk <[email protected]>
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
-- 
PIRONET NDH
Michael Jaszczyk - Director Software
Maarweg 149 - 161, 50825 Cologne - Germany 
Phone: +49 (0)221 770 1720 - Fax: +49 (0)221 770 1005 
<mailto:[email protected]> - <http://www.pironet-ndh.com/>
DatabaseService.patch (text/plain, 1.2 KB)
Index: DatabaseService.java
===================================================================
RCS file: /cvsroot/openjms/openjms/src/main/org/exolab/jms/persistence/DatabaseService.java,v
retrieving revision 1.12
diff -u -w -i -b -r1.12 DatabaseService.java
--- DatabaseService.java	28 Oct 2003 07:27:29 -0000	1.12
+++ DatabaseService.java	5 Jan 2004 09:00:00 -0000
@@ -182,26 +182,14 @@
             connection.commit();
 
         } catch (PersistenceException exception) {
-            if (connection != null) {
-                try {
-                    connection.rollback();
-                } catch (Exception nested) {
-                    // ignore
-                }
-            }
+         	SQLHelper.rollback(connection);
             throw exception;
         } catch (Exception exception) {
             // rethrow as an appropriate exception
             throw new ServiceException("Failed to start the DatabaseService",
                 exception);
         } finally {
-            if (connection != null) {
-                try {
-                    connection.close();
-                } catch (Exception nested) {
-                    // ignore
-                }
-            }
+          	SQLHelper.close(connection);
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.