Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Returning ResultSet from an EJB

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oreilly EJB by RMH talks about returning ResultSet from an EJB to the client.(Page 458-Oreilly)
My question - Is it possible to return a ResultSet from a remote method to the client? To use this resultset won't the client require the open connection that is associated with this resultset. Just serializing the resultset and sending it to the client will this maintain also the open connection?
If the above thing is possible will the client require the JDBC driver to access this resultset that is returned by remote method?
 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Prakash Saswadkar:
Oreilly EJB by RMH talks about returning ResultSet from an EJB to the client.(Page 458-Oreilly)
To use this resultset won't the client require the open connection that is associated with this resultset.


To get a resultset there needs to be a connection but I don't believe that a resultset has an association with a connection after it is returned. A resultset is just another object.
Hope this helps,
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
It is not allowed, the ResultSet is not serialiable, so return a ResultSet to remote client breaks the rules for a RMI-IIOP !
 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Copy your resultset to Collection & they are serializable. Also make sure you have serializable objects or premitives in Collection otherwise you will get runtime error.
Hope this help.
SCJP 1.4
SCWCD
 
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This article has something about disconnected result sets
http://www.javaworld.com/javaworld/jw-02-2001/jw-0202-cachedrow.html

hope it helps
vivek
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like a really bad idea, as it breaks MVC and "Seperation of Concerns" principle. Not to mention breaking the Law of Demeter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic