Title: RE: [JBoss-user] JDBC / ResultSet Question

We use an Stateful Session bean to hold the result set.  The result is persisted when the bean is passivated, so the container can handle any memory issues for large result sets.

The session bean publishes a "paging data access" interface.

This type of solution is documented in the EJB design patterns: http://java.sun.com/j2ee/blueprints/design_patterns/page_by_page_iterator/index.html

BTW.  From a design perspective, I assume that you expect the "client" to actually access the 10,000+ rows at some point.  If the cost of re-querying the database is fairly low/infrequent then it may be better to hit the database again rather than allocate that much memory.


-----Original Message-----
From: Matt Veitas [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 09:40
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] JDBC / ResultSet Question


CachedRowSet is a great way to implement sending a "resultset" over the
wire, but what about in the case where you may have thousands of records to
list.

I am not using JBoss as of now, just using plain servlets/jsp on my project,
but I am always looking for a better way to code the idea of paging through
a ResultSet. Currently in our project we have well over 15,000,000 data
items in the database and a user will do a search for certain criteria. Some
of the queries are returning 10,000+ rows. Right now we have a piece of code
that maintains the connection to the DB, along with the ResultSet so that we
can page through the data set. The jsp page will access it and get the data
straight from the ResultSet.

We will be starting to convert our web app over to EJB in the next few
months, but was how others are handling cases such as this with EJB...I was
thinking about a stateful session bean to take care of this, but the only
question is how to maintain the connection, statement, and ResultSet when
ejbPassivate() needs to be called? Any other suggestions on how to do this
or experiences with such a thing would be great.

Matt

--
[EMAIL PROTECTED]
703-304-6988
____________________________________
Emerging Paradigms Corporation
"innovative ideas for smarter solutions"
http://www.emerging-paradigms.com/


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of David Ward
Sent: Tuesday, June 19, 2001 7:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] JDBC / ResultSet Question


Look at CachedRowSet implementation from Sun - it is Serializable and
can be disconnected:
http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html

David

--

Mike korcynski wrote:

> Hello:
>    I am currently working on a project using JBoss
> 2.2.  I have stumbled upon a strange problem I was
> hoping someone could help me with.  I have a method in
> a session bean that will perform an ad hoc query on a
> database and return the results to the client in a
> ResultSet.  However, it appears that the
> implementation of ResultSet is not serializable:
>   "Caused by: java.io.NotSerializableException:
> org.opentools.minerva.jdbc.ResultSetInPool"
>
>    Am I doing something wrong or is this some sort of
> bug?  It would seem useful to be able to return a
> ResultSet to a client.  Can someone advise?  Thank you
> for your time.
>
> Mike Korcynski
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Spot the hottest trends in music, movies, and more.
> http://buzz.yahoo.com/
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>




_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to