> Dave Smith wrote:
> > Keep the result set open, retieve from the set as necessary, probably
> > using a cursor. That way if someone is doing a search that has
> 1 million
> > records and after I display the first 10 and the client chooses the 3rd
> > one, we have only created 10 objects.
> No, no, no! We can't keep the result set open!
> 1) having open result set and open Connection for each client,
> we'll end up with too many open connections and too many open result
> sets (256 open cursors by default in Oracle).
> 2) How about transaction bounds? Can you keep cursor open after
> transaction ends? I don't think so.
What about making an automatic paging? Think about something LIKE an open
cursor. I'll try to be brief. Suppose this query to return 1,000,000
records:
SELECT ID, NAME FROM TABLE
ORDER BY NAME;
Suppose that you make a PagedCollection (configurable from
jbosscmp-jdbc.xml) that only get the first 50 records (and you close the
resultset). You show them. When someone tries to get the #51 record and so
you make another call (possibly in another new Transaction context)
SELECT ID, NAME FROM TABLE
WHERE ID > #the ID of record 50#
ORDER BY NAME;
And so on. It would be more effective than any solution the programmer could
make by hand. Are there Transaction consecuences on this? I could be missing
something.
My 2c.
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development