aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes interesting issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "interesting issue" Watch "interesting issue" New topic
Author

interesting issue

rose deng
Ranch Hand

Joined: Dec 29, 2000
Posts: 78
HI,
I have following method A in sessionbean A:
methodA()
{
try
{
methodB();
methodC();
}
catch(application exception)
{
sessioncontext.setRollbackOnly();
}
}
methodB() will call entityHome1 to instantiate entity bean1 and insert a record in table1; methodC() will call entityHOme2 to instantiate entity bean2 and insert a record in table2.
sessionbean and entitybean use container-managed transaction, and all method's transaction's attribute is required.
when methodC failed to insert record in table2, seems new inserted record in table1 rollback, because i use oralce sqlplus to inquiry, and no that record.
But the issue is when i use application to insert same record in table1, it always throw out duplicatekey exception. even i stop the test server and restart a couple of times, still the same. I'm wondering it's ejbobject cache??
I use wsad4.0 test server and oracleXADatasource.
So what do you think the possible reason behind such interesting issue.
Thanks!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interesting issue
 
Similar Threads
Urgent transaction question!
Why not rollback???
One2One Uni-directional Problem
Thread behaviour
Exception handling