0 Replies Latest reply on Aug 29, 2001 6:32 PM by Rajesh

    Passivation Problem...

    Rajesh Newbie

      I checked the archives, but I couldnt find a solution to this problem I'm facing.
      I have a Stateful Session Bean(eg. PersonSession). This SFSB holds an object "Person" as its attribute. This "Person" object in turn holds another object called "Address". When the Person attribute in the SFSB is instantiated, the Person object also initializes the Address object(which it holds). During this initialization of "Address", it hits the Database and loads some of its own attributes. It uses our own Connection pooling mechanism to hit the database. This works all well.
      But, when JBoss tries to passivate the SFSB, it throws me the following exception.

      java.rmi.ServerException: Could not passivate; nested exception is:
      java.io.NotSerializableException: oracle.jdbc.driver.OracleConnection
      java.io.NotSerializableException: oracle.jdbc.driver.OracleConnection
      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
      at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827)
      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)

      Could anybody tell me how to eliminate this issue. Since, I'm not making any database connections directly from the SFSB, I'm not able to do a disconnect in ejbPassivate() and a lookup in ejbActivate()(I dont have a reference to the Database connection pool inside the SFSB at all). All the Database connections are done deep down in the object hierarchy. I would really appreciate if someone could show me the light.
      Thanks,
      Winston.