Hi David, The MVCSoft Persistence Manager (currently available for JBoss and WebLogic) provides the ability to page through results of a query, stepping forward, backward, or jumping into the middle. The exact mechanism used by the CMP engine varies by database: you can use a scrollable cursor; simple iteration through a result set (without the overhead of instantiating entity beans); "limit" syntax; or "limit/offset" syntax. If any good technique is missing I'll be happy to add it.
The user code takes advantage of this by calling a wrapper method in the bean, passing in a "start" and a "size" parameter, for which an overloaded method is provided at deploy time. This gives the user the ability to write 100% portable code, by providing an alternate implementation of the wrapper method that simply iterates through the query results and wouldn't be overridden by a different persistence manager. (Of course, this would be a "performance bug" in a different container unless other vendors had their own mechanism for paging through results.) The documentation for this feature is included in the MVCSoft product documentation and is freely available from www.mvcsoft.com. This documentation also has an extensive explanation of EJB 2.0 persistence and might be valuable to you even if you're not interested in the product. -Dan On 1 Nov 01, at 11:38, David Levine wrote: > If I were to use entity beans to represent items in a catalog, and the # of > items was fairly large (tens to hundreds of thousands), the Collection > returned by a findBy might be huge. > > I can certainly see how one would build a traditional "paging" mechanism > using BMP (to get only a subset of results, and be able to step forward or > backwards through the catalog). But is it possible to do using CMP? My > instinct is "no", that this is a case where BMP is necessary. But I just > thought I'd ask to see if anyone has thoughts to the contrary. > > Thanks, > David > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
