It really depends. All JBoss really needs in the collection is the primary key of the object and all the other datadta can be loaded on demand. You will have to try the code and see how it works for you.
Thanks for the response. I dont see any why to do operations like previous. I know I can do things like next. How do I support scrolling like operations with CMP. Will I have to bypass CMP and use straight JDBC for operations that return large result sets.
Thanks for all your help.
I think your problem could be solved by implementing the ValueListHandler-Pattern (see J2EE patterns catalog provided by Sun). Essentially this means caching your data either on the server-side or client-side. If you prefer server-side (thus avoiding unnecessary network-traffic), consider using a stateful session-bean, which returns a collection and iterator providing the funcionality that suits your needs.
Hope it helps,
P.S.: I'll have to implement this feature soon, especially for search-results. So don't hesitate to contact me.
> Thanks for the response. I dont see any why to do
> operations like previous. I know I can do things like
> next. How do I support scrolling like operations with
> CMP. Will I have to bypass CMP and use straight JDBC
> for operations that return large result sets.
You just get a collection by searching for the rows with a finder, ejbSelect or relationship collection (set read-ahead to none). Then you have a collection you can copy into an ArrayList and iterate over (forwards and backwards).