Re: EJB Passivation with Weblogic

Madhav Inamti <[email protected]> Tue, 25 Mar 2003 08:21:49 -0800
Newsgroups gmane.comp.java.sun.connector
Message-ID <75C025AE395F374B81F6416B1D4BDEFB0108D02F@mtv-corpmail.microfocus.com>
Jim,



I guess there is no other choice at this time. Just wondering how the other
connector vendors have tackled this. Making the connection transient will
avoid this. However, at activation, the proper ManagedConnection needs to be
associated with the connection to preserve the conversation state with the
EIS.



Thanks,



Madhav



-----Original Message-----
From: Jim Gish [mailto:[email protected]]
Sent: Tuesday, March 25, 2003 7:55 AM
To: [email protected]
Subject: Re: EJB Passivation with Weblogic



Madhav,

I was just looking at the code.  The problem is indeed that
ConnectionWrapper is not Serializable.  We're looking at ways of improving
our connection proxy situation (through alternative mechanisms that don't
cause this or other problems), but that obviously doesn't help you at the
moment.  Clearly, making your Connection handle transient will avoid the
symptom, but is that feasible in your situation?

Jim Gish
BEA Weblogic Connector Team Lead


At 09:45 AM 3/25/2003, you wrote:




Can anyone from BEA comment on this ?



Thanks,

Madhav



-----Original Message-----
From: Allwin Immanuel [mailto:[email protected]
<mailto:[email protected]> ]
Sent: Monday, March 24, 2003 7:35 PM
To: [email protected]
Subject: Re: EJB Passivation with Weblogic



Madhav,



Yea, weblogic.connector.common.internal.ConnectionWrapper is not
serializable. That could be the problem.



Allwin.



-----Original Message-----

From: Madhav Inamti [mailto:[email protected]
<mailto:[email protected]> ]

Sent: Tuesday, March 25, 2003 8:28 AM

To: [email protected]

Subject: Re: EJB Passivation with Weblogic

Allwin,



My impl of javax.resource.cci.Connection is Serializable. I have verified
this with writeObject. I have a feeling it is Weblogic's Proxy Wrapper that
is causing this. Any thoughts ?

May be I should set the connection to be transient. In that case at
Activation I need to associate to connection, the proper ManagedConnection
myself.



Madhav



-----Original Message-----

From: Allwin Immanuel [mailto:[email protected]
<mailto:[email protected]> ]

Sent: Monday, March 24, 2003 6:52 PM

To: [email protected]

Subject: Re: EJB Passivation with Weblogic



Madhav,



The reason for the error is:

javax.resource.cci.Connection is not serializable (Serializability of a
class is enabled by the class implementing the java.io.Serializable
interface. Classes that do not implement this interface will not have any of
their state serialized or deserialized.).



Solution:

Assign the instance's fields storing the connections to null.



Below text is taken from the ejb spec :



Instance passivation and conversational state

The Bean Provider is required to ensure that the ejbPassivate method leaves
the instance fields



ready to be serialized by the Container. The objects that are assigned to
the instance's non-transient



fields after the ejbPassivate method completes must be one of the following:




 A serializable object .

 A null.

 An enterprise bean's remote interface reference, even if the stub class is
not serializable.

 An enterprise bean's remote home interface reference, even if the stub
class is not serializable.

 ........



This means, for example, that the Bean Provider must close all JDBC
connections in ejbPassi-vate

and assign the instance's fields storing the connections to null.



Thanks,

Allwin

-----Original Message-----

From: Madhav Inamti [mailto:[email protected]
<mailto:[email protected]> ]

Sent: Monday, March 24, 2003 11:20 PM

To: [email protected]

Subject: EJB Passivation with Weblogic

When I have a stateful bean being passivated with Weblogic,  I get an error



<Error> <EJB> <010024> <Error during passivation:

java.io.NotSerializableException:
weblogic.connector.common.internal.ConnectionWrapper



I have the javax.resource.cci.Connection as an EJB instance variable.



Would appreciate some comments on this from folks who have been able to
passivate and activate stateful EJB using Weblogic.



Thanks in advance,



Madhav