dcsimg
magical transformation from primary key into remote references when returned from find method
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alex_Chaffee
Posted On:   Tuesday, December 11, 2001 07:17 PM

When I return a Collection from a find method, I fill it with Primary Key objects. When it arrives at the client, it contains remote references. Why does it behave this way? What can I do if I really want to return a list of primary key objects instead?


This behavior occurs under Weblogic 6.1 -- does it happen with other servers?


If I have a huge number of results -- say 100,000 -- then won't this waste resources on the server, making 100,000 remote stubs?

Re: magical transformation from primary key into remote references when returned from find method

Posted By:   Bozidar_Dangubic  
Posted On:   Wednesday, December 12, 2001 07:24 AM

alex, it will waste resources. your find method gives a collection of primary keys but the container converts those primary keys into remote references before sending them to the client. it does that when you search by primary key and return a single remote reference as well as when you search by some other attribute and return a collection. both searches are treated the same by the container - it takes primary key class(es) and generates remote reference(s) to pass to the client. if you are doing searches that frequently produce large number of records my suggestion is to stay away from entity beans or create a session facade with entity bean implemented as Local. you can have session facade get the search calls, make calls on the entity beans and return something other than the remote reference (e.g. Collection of primary keys). that is possible. but if you directly access finder methods in the entity beans you will always get a single or collection of remote references.
About | Sitemap | Contact