Hi Hubert,

I post your proposal to the dev-list to
discuss the side-effects.

regards,
Armin

----- Original Message -----
From: "Hubert Hausegger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 06, 2003 8:53 PM
Subject: Bug in PersistenceBrokerImpl


> Hi All!
>
> I'm using OJB in a project with about 90 Business/Entity - Classes
with
> objectreferences and a single rootclass. I've noticed a very poor
> performance in loading objects from the db. When they are loaded
> into the cache, everything is fine.
> Loading about 100 objects into the cache took about 100secs!
>
> Looking into the PersistenceBrokerImpl.java I found the Problem:
>
> /**
>  * retrieves an Object reference.
>  * <br>
>  * If there is a Proxy-class is defined in the ReferenceDescriptor or
>  * if the ReferenceDescriptor is lazy, a Proxy-object is returned.
>  * <br>
>  * If no Proxy-class is defined, a getObjectByIdentity(...) lookup is
> performed.
>  * <br>
>  * Null is returned if all foreign keys are null
>  */
> private Object getReferencedObject(Object obj,
>
> ObjectReferenceDescriptor rds,
>                                                      ClassDescriptor
cld)  {
>         Class referencedClass = rds.getItemClass();
>
>   <bug>
>   // ensure that top-level extents are used for Identities
>   file://hh: referencedClass =
>   file://hh:
descriptorRepository.getTopLevelClass(referencedClass);
>   </bug>
>
>   Object[] pkVals = rds.getForeignKeyValues(obj, cld);
>   Class referencedProxy;
>   boolean allPkNull = true;
>
>
> To get a referenced object, the persistence broker was searching the
object
> in all tables and not just in the tables down the inheritance tree!!
> (I'm using 1 class /table)
> After removing the statement listed above, the same operation now
> takes only 3 secs!. Is'nt this a great Performance Improvement?
>
> By the way: OJB is a great project - thank you guys!
>
>  - Hubert
>
> --
> +++ GMX - Mail, Messaging & more  http://www.gmx.net +++
> Bitte l�cheln! Fotogalerie online mit GMX ohne eigene Homepage!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to