According to my understanding in hibernate (please confirm)
1- You have to session.close() if you get it by getSessionFactory().openSession()
session.close()
getSessionFactory().openSession()
Whenever Your are doing save(), Always commit the transaction once done.
Account ac =new account() ac.insert(123); ---------- ---------- ---------- ---------- session.save(ac); // Add this bottom line session.getTransaction().commit();