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 Joerg Lensing <in...@softcon-lensing.de> on 2003/09/26 12:33:14 UTC

Question Proxy

Hi All,
I compared the p6Spy-statements of proxied and non-proxied classes. The 
class (userPO)
is 1) dynamic proxy  and
    2) no proxy

I queried this class directly  (s.b)
        Query query = new QueryByCriteria(UserPO.class, null);
        Collection result = broker.getCollectionByQuery(query);

The "dynamic proxy" produces 96 select-statements - the non-proxy only ONE!
Can someone explain me this? (see zip-File for the sql.log)

tx joerg



Documentation Tool?

Posted by Michael Watson <mi...@estafet.com>.
Are there any tools out there that will parse a repository xml document and
produce some half decent documentation to show the structure and
relationships between objects to be persisted?


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


Re: Question Proxy

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi roland,

you can also use a proxied reference.
i'd prefer using proxied collections and proxied references instead of 
proxied classes.
the worst thing you can do is mixing both concepts :(

hth
jakob


Roland Carlsson wrote:

>I just wanna add that you can use a collectionProxy. Read about it in the
>"Advanced O/R" on the homepage of ojb. It will only use one query to
>materialize you collection of objects.
>
>Regards
>Roland Carlsson
>
>----- Original Message ----- 
>From: "Jakob Braeuchi" <jb...@gmx.ch>
>To: "OJB Users List" <oj...@db.apache.org>
>Sent: Friday, September 26, 2003 5:47 PM
>Subject: Re: Question Proxy
>
>
>  
>
>>hi joerg,
>>
>>well this works as designed.
>>if the class in non proxied the select immediately materializes the
>>fetched rows.
>>if the class is proxied only the identities are built and wrapped by a
>>proxy. the first time you access a method of the proxy it materializes
>>the real object resulting in a select with primary keys.
>>in your case the first sql is to select the primary keys (ojb always
>>select all rows not pk only) and the other 95 are for materialization.
>>
>>hth
>>jakob
>>
>>Joerg Lensing wrote:
>>
>>    
>>
>>>Hi All,
>>>I compared the p6Spy-statements of proxied and non-proxied classes.
>>>The class (userPO)
>>>is 1) dynamic proxy  and
>>>   2) no proxy
>>>
>>>I queried this class directly  (s.b)
>>>       Query query = new QueryByCriteria(UserPO.class, null);
>>>       Collection result = broker.getCollectionByQuery(query);
>>>
>>>The "dynamic proxy" produces 96 select-statements - the non-proxy only
>>>ONE!
>>>Can someone explain me this? (see zip-File for the sql.log)
>>>
>>>tx joerg
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>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


Re: Question Proxy

Posted by Roland Carlsson <ma...@javalia.se>.
I just wanna add that you can use a collectionProxy. Read about it in the
"Advanced O/R" on the homepage of ojb. It will only use one query to
materialize you collection of objects.

Regards
Roland Carlsson

----- Original Message ----- 
From: "Jakob Braeuchi" <jb...@gmx.ch>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Friday, September 26, 2003 5:47 PM
Subject: Re: Question Proxy


> hi joerg,
>
> well this works as designed.
> if the class in non proxied the select immediately materializes the
> fetched rows.
> if the class is proxied only the identities are built and wrapped by a
> proxy. the first time you access a method of the proxy it materializes
> the real object resulting in a select with primary keys.
> in your case the first sql is to select the primary keys (ojb always
> select all rows not pk only) and the other 95 are for materialization.
>
> hth
> jakob
>
> Joerg Lensing wrote:
>
> > Hi All,
> > I compared the p6Spy-statements of proxied and non-proxied classes.
> > The class (userPO)
> > is 1) dynamic proxy  and
> >    2) no proxy
> >
> > I queried this class directly  (s.b)
> >        Query query = new QueryByCriteria(UserPO.class, null);
> >        Collection result = broker.getCollectionByQuery(query);
> >
> > The "dynamic proxy" produces 96 select-statements - the non-proxy only
> > ONE!
> > Can someone explain me this? (see zip-File for the sql.log)
> >
> > tx joerg
> >
> >
> >------------------------------------------------------------------------
> >
> >---------------------------------------------------------------------
> >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
>
>



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


Re: Question Proxy

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi joerg,

well this works as designed.
if the class in non proxied the select immediately materializes the 
fetched rows.
if the class is proxied only the identities are built and wrapped by a 
proxy. the first time you access a method of the proxy it materializes 
the real object resulting in a select with primary keys.
in your case the first sql is to select the primary keys (ojb always 
select all rows not pk only) and the other 95 are for materialization.

hth
jakob

Joerg Lensing wrote:

> Hi All,
> I compared the p6Spy-statements of proxied and non-proxied classes. 
> The class (userPO)
> is 1) dynamic proxy  and
>    2) no proxy
>
> I queried this class directly  (s.b)
>        Query query = new QueryByCriteria(UserPO.class, null);
>        Collection result = broker.getCollectionByQuery(query);
>
> The "dynamic proxy" produces 96 select-statements - the non-proxy only 
> ONE!
> Can someone explain me this? (see zip-File for the sql.log)
>
> tx joerg
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>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