> when I invoke a finder for a CMP EJB and this returns
> a Collection with 1000 bean instances, do all these
> instances really already exist then.
Depends on the server. In JBoss you just get a proxy from the instance pool.
> (If yes then I know why EJB is slow).
EJB isn't slow, crapy application code and crapy servers are slow.
> Wouldn't it be much better if a finder could return
> one factory object instance. This object has the
> result-set and creates instances on demand.
> I could then at first ask this one how many entries
> are available and then instanciate certain ones.
> E.g. in an webbased app, I would do that just 10 at
> one to display them page by page.
You can't do it exactally this way, but JBoss implements the essences of this process. Closely ready the JDBC spec and you will find that you can't hold on to a result set out side of a transaction (nor would you want to), and you can't determinde the number of rows in a result set without iterating over it (a basic database issue).