On Wed, 23 May 2001, Dave, Pragnesh wrote:

> Greetings !
> 
> David, thanks for pointing that the CallableStatement doesn't implement
> Serializable.
> 
> I checked the docs and got the same info; I got confused as I was previously
> using VAJ and websphere and the "data connector-DAB" extension allows to
> Serialize CallableStatement; basically IBM extended the CallableStatement
> and implemented Serializable.
> 
> In one the articles at developerworks, Cynthia Saracco actually says that
> wrapping DBMS stored proc under stateless session beans is a "good" idea and
> passing the Serialized CallableStatement back to the client a better
> approach then creating your own Collection.
> 
> http://www-106.ibm.com/developerworks/components/library/j-spejb/?dwzone=com
> ponents

(I didn't bother reading the article ;)

I guess the reason for passing the CallableStatement to the client is that
you don't want to first "unroll" the ResultSet, put it into a Collection
and then pass that Collection to the client who has to iterate it again.
If the CallableStatement does not produce a ResultSet then there would be
no point.

You could use a Stateful Session Bean instead and store the ResultSet in
the bean and add a method that gets the next row from the ResultSet. The
more beautiful solution would be to implement a Serializable iterator and
pass that back to the client. The next() method in the iterator would get
the next row from the Session Bean.

Cheers

-----------------------------------------------------------------------
Per Lewau ([EMAIL PROTECTED]) 

"Why waste time learning, when ignorance is instantaneous?"
                                                - Hobbes


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

Reply via email to