Actually DataObject serialization mechanism is very efficient, so what you
see is not a handicap, but a feature... The idea is that unless object is
modified, there is no need to write its properties, as on deserialization
it will attach to a DataContext/ObjectStore/underlying cache that will
provide missing values on demand.
This implies that a DataContext/ObjectStore make sense on the
deserialization side (client side in your case), so the most common
pattern is serializing the whole DataContext. I recommend doing that.
If this is not desirable (no Cayenne on the client) then you will need to
do some tweaking ... we can discuss options further.
Andrus
> OK - I finally found some stuff after googling and I'm a bit nervous
> that from what I've read you need to re-attach a DataContext to each
> object in the list of results that have been serialized. This seems on
> the surface to be a severe handicap but I'm still not sure what the best
> practice is for this type of problem.
>
>
> On Tue, 8 Mar 2005 10:41:26 -0600, Michael Engelhart
> <moosebrookfar..mail.com> wrote:
>> Hi -
>>
>> I just ported my Hibernate based JBoss application to use Cayenne and
>> am finding some strange problems which I think are due to
>> serialization issues. I am using Message Driven Beans to request
>> multiple database lookups per request. MDB's serialize the
>> request/response and then deserialize to get the data out. This
>> worked fine with Hibernate.
>> With Cayenne, the data is fine before the data is serialized and
>> stuffed into the response but when I log the returned ArrayList from
>> the MDB, all the values are null except for the objectId.
>>
>> I can't easily follow what's going on with CayenneDataObject classes
>> as they implement DataObject which is a superclass of
>> java.io.Serializable, java.io.Serializable and XMLSerializable.
>>
>> Any advice would be appreciated.
>>
>> Thanks
>> Mike
This archive was generated by hypermail 2.0.0 : Tue Mar 08 2005 - 13:57:15 EST