From 07913e9b8a89cfa59984ace69fe39ed54b41606c Mon Sep 17 00:00:00 2001
From: ulrich
Date: Tue, 26 May 2020 08:39:12 +0000
Subject: [PATCH] Anpassung an der Klasse Util, Doku angepasst

---
 src/de/uhilger/baselink/PersistenceManager.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/de/uhilger/baselink/PersistenceManager.java b/src/de/uhilger/baselink/PersistenceManager.java
index f3f8786..66d2147 100644
--- a/src/de/uhilger/baselink/PersistenceManager.java
+++ b/src/de/uhilger/baselink/PersistenceManager.java
@@ -129,7 +129,6 @@
   /**
    * Get a database connection
    * @return  a database connection
-   * @throws SQLException
    */
   public Connection getConnection() {
     Connection c = null;
@@ -893,7 +892,7 @@
     try {
       c.setAutoCommit(false);
     } catch(SQLException ex) {
-      logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
+      logger.log(Level.SEVERE, ex.getMessage(), ex);
     } finally {
       // ..
     }
@@ -902,22 +901,28 @@
   public void commit(Connection c) {
     try {
       c.commit();
-      c.setAutoCommit(true);
     } catch(SQLException ex) {
-      logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
+      logger.log(Level.SEVERE, ex.getMessage(), ex);
     } finally {
-      // ... 
+      try {
+        c.setAutoCommit(true);
+      } catch (SQLException ex) {
+        logger.log(Level.SEVERE, ex.getMessage(), ex);
+      }
     }
   }
   
   public void rollback(Connection c) {
     try {
       c.rollback();
-      c.setAutoCommit(true);
     } catch(SQLException ex) {
       logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
     } finally {
-      // ...
+      try {
+        c.setAutoCommit(true);
+      } catch (SQLException ex) {
+        logger.log(Level.SEVERE, ex.getMessage(), ex);
+      }
     }
   }
   

--
Gitblit v1.9.3