one problem will be that if you are running invm tomcat/jboss and your proxy 
materialization happens AFTER the transaction is over, you'll need a mechanism to know 
that the tx is over, because you were never serialized.

I've thought a lot about this problem, and started to implement the 
persistencebrokerbean to solve it, then got sidetracked.

m

-----Original Message-----
From: Phil Warrick [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 11:41 AM
To: OJB Users List
Subject: Re: RMI and Proxied collections and references


Thomas Mahler wrote:
>> I think this problem could be resolved by providing a configuration 
>> option that would turn-on proxy materializing triggered by 
>> serialization of persistent classes. This would result in fully 
>> materialized model transfered to a client, and transparent proxy 
>> handling for serialization.
> 
> 
> Yes, this could be an elegant solution! AFAIK there are some callbacks 
> in the serialization api that could help to implement this trick.
> Only disatvantage I see: persistent classes must be derived from a base 
> class implementing these callbacks?
> 

Any Serializable class can override these two functions for special 
handling during serialization/deserialization:

  private void writeObject(java.io.ObjectOutputStream out)
      throws IOException
  private void readObject(java.io.ObjectInputStream in)
      throws IOException, ClassNotFoundException;

So the only base assumed is the Serialization interface.
I do this when I want to ensure that certain proxies (or transient 
objects) are materialized during serialization or deserialization.  I 
too do not use c/s (I do use ejb with jboss) and I want the flexibility 
to choose how heavy my serialized object is under different conditions.

I'm interested to see where this all leads...

Phil



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to