db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: bug when locking objects with references to proxies
Date Wed, 11 Aug 2004 15:12:03 GMT
Hi Georg,

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

I my opinion you are right. I removed this check and use
ProxyHelper.getRealClass(ref)
to lookup class of refernece and remove the
if (refInstance != null)
...else
block too.
Seems that all tests pass. Nevertheless can you send me your patch (or 
eclipse diff), then I can check my changes against your patch.

Thanks,
Armin


Georg Schneider wrote:

> 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
> 
> 

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


Mime
View raw message