db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: PersistenceManager extends Serializable
Date Thu, 19 Oct 2006 01:05:06 GMT
Hi Geoff,

I was thinking that there is no reason why the PM can't serialize to  
a stream an instance that it knows how to store in a database. It's  
easier, after all, than generating SQL for storage.

So I'd mandate that the PM cannot throw not-serializable for  
persistent instances. Instances that implement Serializable get  
stored in the "normal" way. Instances that don't get stored in a PM- 
specific format in the stream. It's only instances that the user  
wants to store in the session directly that need to be Serializable  
(this because that is a container contract).


On Oct 18, 2006, at 5:01 PM, Geoff hendrey wrote:

> If the instances in cache are not serializable, then an exception  
> gets thrown at runtime when the instance in cache tries to serialize.
> (of course a PM might be "super smart" and might know how to  
> serialize a PersistanceCapable instanc. Heck, it already knows how  
> to map a PC to a database).
> :-)
> -geoff
> ----- Original Message ----
> From: Michael Bouschen <mbo.tech@spree.de>
> To: jdo-dev@db.apache.org
> Cc: JDO Expert Group <jdo-experts-ext@sun.com>
> Sent: Wednesday, October 18, 2006 2:43:43 PM
> Subject: Re: PersistenceManager extends Serializable
> Hi Craig,
> I think this is a good idea, since it would allow storing a
> PersistenceManager as a session attribute (for whatever purpose). The
> interesting question is whether any caches get serialized along  
> with the
> PersistenceManager? What happens with cached persistent instances of a
> non-serializable class?
> Regards Michael
>> Javadogs,
>> For easier development of web applications, it would be nice if
>> PersistenceManager were Serializable. There is nothing stopping an
>> implementation from declaring that their implementation extends
>> Serializable, but the behavior is implementation-specific.
>> For the maintenance release, I'd like to see if we can agree on the
>> behavior of serializing a PersistenceManager if it does implement
>> Serializable.
>> Craig
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
> -- 
> Michael Bouschen        Tech@Spree Engineering GmbH
> mailto:mbo.tech@spree.de    http://www.tech.spree.de/
> Tel.:++49/30/235 520-33        Buelowstr. 66
> Fax.:++49/30/2175 2012        D-10783 Berlin

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!

View raw message