This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes CMP and ObjectNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "CMP and ObjectNotFoundException" Watch "CMP and ObjectNotFoundException" New topic

CMP and ObjectNotFoundException

Andreas Amstutz

Joined: May 16, 2002
Posts: 2
Hi all,
I have this session bean method, which creates an order - and on success sends a msg to a JMS-queue.
OrderLocalHome ohome = getOrderLocalHome( );
OrderLocal order = ohome.create( userId, orderDate );
JMSUtil.sendToJMSQueue( JNDINames.QUEUE_ORDER, order.getOrderUId, false );
Some time later the OrderProcessorMDB gets the msg and, among other things, tries to modify the before created order.
Here do I get the "ObjectNotFoundException" for orderHome.findByPrimaryKey().
But there is an order with the corresponding PK in the database.
When I place additional orders the OrderProcessorMDB.onMessage() never sees the least created order.
That means ohome.findAll() allways returns a collection not containing the very latest placed order.
I simply don't get!
Any ideas?
Thanks, Andreas
subject: CMP and ObjectNotFoundException
It's not a secret anymore!