Re: magical transformation from primary key into remote references when returned from find method
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.