Java singleton VO class implementing serializable, having default values using getter methods

Posted by user309281 on Stack Overflow See other posts from Stack Overflow or by user309281
Published on 2010-05-04T15:14:23Z Indexed on 2010/05/04 15:18 UTC
Read the original article Hit count: 260

Filed under:
|
|
|

Hi All

I have a J2SE application having user threads running in a separate JVM outside JBOSS server. During startup, J2SE invokes a EJB inside jboss, by passing a new object(singleton) of simple JAVA VO class having getter/setter methods. {The VO class is a singleton and implements serialiable(as mandated by EJB)}.

EJB receives the object, reads all db configuration and uses the setter methods of new object to set all the values. It then returns back this updated object back to J2SE in the same remote call.

After J2SE receives the object(singleton/serializable), if i invoke getter methods, I could see only default values set during object creation before EJB call, and not the values set by the EJB.

Kindly throw some light on, why the received object from EJB does not see any updated values and how to rectify this.

I believe it got to do with object initialization during deserialization. And i tried overriding readResolve() in the VO class, but of no help.

With Regards, Krishna

© Stack Overflow or respective owner

Related posts about java

Related posts about ejb