This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes when the CMR collection gets refreshed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "when the CMR collection gets refreshed?" Watch "when the CMR collection gets refreshed?" New topic
Author

when the CMR collection gets refreshed?

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi all,
I have two CMR beans- Order and Item for e.g. As I created relation b/w them I have getItems() in Order entity bean that returns me Collection of Local Item EJB objects. Now, I have remove Item called directly on the item's local home interface from somewhere else (I don't use collection.remove() here) but as my Order had Collection referring to older Item, getItems() won't refer to the latest list anymore , right?
Does it mean that right after remove() I can't call getItems() here but I have to write a finder method for Item bean to get me all Items which will make sure everytime I get updated list of Items?
I know EJB Container has to refresh the entity bean at specified "refresh interval" but I am talking about the time in between I call remove() and container calls refresh...
I guess this would be all really container specific but any ideas referring to any specific container would be helpful to me...

Regards
Maulin
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
ok. i would answer it myself
I observed that it gets the correct collection (even if database in backend was modified) whenever get<<Collection>> method is called. This is in Sun ONE.
Regards
Maulin
 
GeeCON Prague 2014
 
subject: when the CMR collection gets refreshed?