Hi,
I´m using Hibernate 2.0.2, Oracle 8.1.7 and JBoss 3.2.3.
I have a method as follows:
// Obs.: the attribute dsTest of test is updated in called of the method insertTest(..) public void insertTest(Test test) { Session session = null; Transaction tx = null; try { session = dataSource.openSession(); tx = session.beginTransaction(); session.update(test, session); // gets from database Test aux = session.load(Test.class, test.getIdTest()); // if the object from database (aux) is different than test if (!test.getDsTest().equals(aux.getDsTest())) { session.update(teste.getOtherObject(), session); } tx.commit(); . . . }
Ho, sorry... I forgot...
I was created a service in JBoss with MBean
and I´m using JTATransaction. It seems that it is using this Transaction Manager and the first sess.update was commited before
tx.commit().