Code example for Connection

Methods: rollback

0
     *             if a database access error occurs 
     */ 
    public static void rollbackTransaction(final Connection conn,
            final SQLException e) throws SQLException {
        if (conn != null) {
            conn.rollback();
            logger.fatal("Connection rollback..."); 
            logger.fatal(e.getStackTrace());
 
            StringWriter sWriter = new StringWriter();
            e.printStackTrace(new PrintWriter(sWriter));
            logger.fatal(sWriter.getBuffer().toString());
        } 
    } 
}