You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Chris Lewington <cl...@ebi.ac.uk> on 2004/03/24 11:52:17 UTC

PersistenceBrokerImpl and Proxies

Hi all,

I have a problem with the following scenario:

Suppose I have a class A which contains a collections of Bs, but the
element class of this Collection is declared to be a user-defined Proxy
type (in other words, the class descriptor for B has a user-defined
proxy specified for it). Also suppose the relation between As and Bs is
m:n. Thus when retrieving an instance of A, I also get with it an
associated Collection of proxies to the Bs.

Assuming use of the PB (ie auto-update defaults to 'false') I now change
something in the A instance (does not matter what), then call pb.store
on A to register the change. Looking at the code the 'store()' method
correctly checks for a top-level Proxy - however when we get to the
'storeCollections' method, and then the call to 'storeCollectionObject'
there is NO check for a Proxy in the 'storeCollectionObject' method.
This is caught in the top-level 'store' method *but only* if auto-update
is set to 'true' - otherwise the method drops out and proceeds to the
'storeMtoNImplementor' call, which first attempts to find a Proxy class
descriptor and then throws a ClassNotPersistenceCapableException.

Have I read the code correctly here? Has anyone else experienced this?
This has cropped up with our application on OJB 0.9.7, but I have
checked the rc5 code and the relevant parts look pretty much the same.

Comments welcome.

Cheers,

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: PersistenceBrokerImpl and Proxies

Posted by Armin Waibel <ar...@apache.org>.
Hi Chris,

currently I'm working on the auto-xxx handling. Please remind me if this 
behaviour will be the same in the upcoming release (or better in CVS, I 
will check in the changes in a few days).

regards,
Armin

Chris Lewington wrote:

> Hi all,
> 
> I have a problem with the following scenario:
> 
> Suppose I have a class A which contains a collections of Bs, but the
> element class of this Collection is declared to be a user-defined Proxy
> type (in other words, the class descriptor for B has a user-defined
> proxy specified for it). Also suppose the relation between As and Bs is
> m:n. Thus when retrieving an instance of A, I also get with it an
> associated Collection of proxies to the Bs.
> 
> Assuming use of the PB (ie auto-update defaults to 'false') I now change
> something in the A instance (does not matter what), then call pb.store
> on A to register the change. Looking at the code the 'store()' method
> correctly checks for a top-level Proxy - however when we get to the
> 'storeCollections' method, and then the call to 'storeCollectionObject'
> there is NO check for a Proxy in the 'storeCollectionObject' method.
> This is caught in the top-level 'store' method *but only* if auto-update
> is set to 'true' - otherwise the method drops out and proceeds to the
> 'storeMtoNImplementor' call, which first attempts to find a Proxy class
> descriptor and then throws a ClassNotPersistenceCapableException.
> 
> Have I read the code correctly here? Has anyone else experienced this?
> This has cropped up with our application on OJB 0.9.7, but I have
> checked the rc5 code and the relevant parts look pretty much the same.
> 
> Comments welcome.
> 
> Cheers,
> 
> Chris
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org