My code is following,
Code:
Session session = null;
java.sql.Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
session = getSession(); // a tools methods that get session from ThreadLocal
session.beginTransaction();
con = session.connection();
stmt = con.createStatement();
//... execute some native SQL operation using statement
//commit the transaction
con.commit();
} catch(Exception ex) {
ex.printStackTrace();
if( con != null ) {
try {
//rollback the transaction
con.rollback();
} catch(Exception e) { }
}
} finally {
if( rs != null ) {
try {
rs.close();
} catch(Exception ex) { }
}
if( stmt != null ) {
try {
stmt.close();
} catch(Exception ex) { }
}
}
When i run this code, some message are displayed, the messages is belong to hibernate, like following,
Code:
2003-10-27 17:50:08 net.sf.hibernate.impl.SessionImpl finalize
warn: afterTransactionCompletion() was never called
but my operations are all successful, how about these messages?
Thanks a lot!