Sudhir , I assume you are using container managed transaction and have default transaction mode for the stateless session bean.
I am unable to replicate the issue on WLS10.3 (openJPA openjpa-1.1.0-r422266:657916) and here is the testcase http://n2.nabble.com/file/n4897872/EJBException.zip EJBException.zip that I used. To throw AppExcetion after the find I have to do the following: em.persist( aDepartment ); em.flush(); Department newDept = em.find( Department.class, aDepartment.getName()+"abc"); if ( newDept == null ) { throw new AppException(new Exception("dept not found")); } With above testcase I am unable to replicate the issue meaning nothing is persisted in the database in case of AppException. Hence the rollback is happening completely (not partial). Please review the attached testcase and let me know how it is different with your application. That will help to isolate your problem. Kevin, In sudhir's code snippet, aDepartment is persisted and aDepartment.getName() is used in the find. I guess aDepartment will be managed after the persist statement and the find will always return a non-null object. So, I think that newDept should never be null. Is my understanding incorrect ? Regards, Ravi. -- View this message in context: http://n2.nabble.com/Problem-of-partial-commit-in-OpenJPA-tp4891679p4897872.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
