Joined: Mon Nov 26, 2012 2:11 pm Posts: 1
|
we have exception like this: "org.hibernate.TransactionException: JTA commit failed". it looks like the two transaction commit caused this problem. Does anyone have a good solution for this please?
in our code, we have
try { ..... session = HibernateFactory.createSession(); tx = session.beginTransaction(); ....
if (elementdetail.getElementid().startsWith("AD_")) { session.saveOrUpdate(elementdetail); tx.commit(); }
... elementapppreferred.setNotes(elementDetails.getNotes());
if (!elementdetail.getElementid().startsWith("AD_")) session.clear(); session.saveOrUpdate(elementapppreferred);
} catch (Exception e) { e.printStackTrace(); if (tx != null) { tx.rollback(); }
|
|