| | |
| | | try { |
| | | c.setAutoCommit(false); |
| | | } catch(SQLException ex) { |
| | | logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex); |
| | | logger.log(Level.SEVERE, ex.getMessage(), ex); |
| | | } finally { |
| | | // .. |
| | | } |
| | |
| | | public void commit(Connection c) { |
| | | try { |
| | | c.commit(); |
| | | } catch(SQLException ex) { |
| | | logger.log(Level.SEVERE, ex.getMessage(), ex); |
| | | } finally { |
| | | try { |
| | | c.setAutoCommit(true); |
| | | } catch(SQLException ex) { |
| | | logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex); |
| | | } finally { |
| | | // ... |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |