You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Georg Schneider <sc...@imp.univie.ac.at> on 2004/08/10 16:46:48 UTC

bug when locking objects with references to proxies

Hi all,

It has been quite a while since I have posted to this list. We have been 
using version 0.95 (I know that is the stone ages) up until now and I 
now have upgraded to 1.0.

While doing that I noticed that the performance was really bad and I 
searched for the reason. We are using a lot of objects that have 
references to other, proxied objects and when looking at the database 
logs I noticed that these proxies were constantly materialized.

I narrowed down the problem to the method assertFkAssignment(...) in 
TransactionImpl:

             if (!ProxyHelper.isProxy(obj) && (ref != null))
             {
                 Object refInstance = ProxyHelper.getRealObject(ref);

The preceeding code checks if the object on which the FKs are set is not 
a proxy and the reference is not null and then it immediately 
materializes the proxy, making a proxy useless. Besides the code a few 
lines down

refPkValues = getBroker().serviceBrokerHelper().getKeyValues(refCld, 
refInstance, false);

perfectly handles proxies anyway because getKeyValues(...) in 
BrokerHelper doesn't materialize if refInstance is a proxy.

I changed the code correspondingly and now it is up to the usual speed.

Could you please tell me if I am correct or if there is something I 
don't see.

Cheers

Georg


-- 
============================================================================
Georg Schneider
Bioinformatics Group
Research Institute of Molecular Pathology (IMP)
Dr. Bohr Gasse 7
A-1030 Vienna
Austria


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