Transaction tx = null; try{ tx = session.beginTransaction(); //your code to save tx.commit(); }catch(Exception ex){ tx.rollBack(); ex.printstacktrace(); //log to see if there is any other error }
Transaction tx = null; try{ tx = session.beginTransaction(); //your code to save tx.commit(); }catch(Exception ex){ tx.rollBack(); ex.printstacktrace(); //log to see if there is any other error }