openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi P Palacherla <ravi.palache...@oracle.com>
Subject Re: Problem of partial commit in OpenJPA
Date Tue, 13 Apr 2010 19:08:41 GMT

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.

Mime
View raw message