Thorbjørn Ravn Andersen wrote:
This turned out to be both an interesting exercise and a learning experience regarding different . It is not a problem to store a scrollable resultset as a session attribute in JSP and navigate back and forth with a PostgreSQL database on OpenSolaris so that was working nicely.
Hold on though - this means you need a stateful HTTP session, right? That is, you keep the database connection from one request to the next. If you have that and 1000 users, and you all use a connection pool with only 100 entries, then the pool will run out of connections. It's basically a stateful design.

It then turned out that the PostgreSQL JDBC driver loads the complete resultset in memory when needing to be able to page back and forth, which was the whole idea to avoid so that was an unpleasant surprise having 11 million rows in my testset. So now I've learned that not all JDBC-drivers are created equal :)
I expected this. If the result set is truly disconnected, then you would have to either hold all the data in memory, or else you have to create a new index each time.

Now, you may have a really smart result set that can handle paging, but it will require a stateful connection. That's why I say that putting the resultset in the JSP session is cheating: you cannot release the connection back to the pool, so you are in effect entirely stateful. Whether your stateful connection is a JDBC connection or an AS400 object makes no difference.

Joe

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.