2 Replies Latest reply on Dec 18, 2001 1:19 PM by l.g.

    Marshaling ResultSet

    jmschust

      I seem to be having a marshaling problem because I'm trying to pass back a ResultSet to my ejb client. I get:

      RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: Transaction rolled back; nested exception is:
      java.lang.ClassCastException: org.jboss.pool.jdbc.ResultSetInPool

      Any advice on how to do this without having to create a container?

        • 1. Re: Marshaling ResultSet
          hstech

          A common solution is to populate one or more Value Objects with the contents of the ResultSet. The Value Objects need to be serializable classes.

          The problem with passing a ResultSet is that, in order to pass an object from the server to the client, the object needs to be serializable. However, since ResultSet defines only an interface, you can't guarantee whether or not the implementation of the ResultSet is serializable or not. This could easily change between vendors, so your app loses it's portability.

          HTH,
          Aaron.

          • 2. Re: Marshaling ResultSet
            l.g.

            Try CachedRowSet
            http://developer.java.sun.com/developer/earlyAccess/crs/
            It works great for me. However it does not work with Sybase as is and maybe with some other DBMS (there is a workaround)