The problem in my code was :
Session session = null; Transaction tx = null; session = PriorityWrapperHibernateUtil.getOneTimeSession(); tx = session.getTransaction(); for (int i = 0; i < objects.length; i++) { Object object = objects[i]; session.saveOrUpdate(object); } if(tx != null){ tx.commit(); }
instead, it should be : tx = session.beginTransaction();
I used the Koders site to find out where the exception is comming from
No comments:
Post a Comment