Re: advantage of forceProxies=true?

Armin Waibel <[email protected]>
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Hi,

MA wrote:
> Hi ,
> 
> I wanted to know the best setting for performance.
> I have a Table A and a table B (1:n) with the n side relationship having
> potentially large data.
> 
> So if i use ObjectCacheTwoLevel and forceProxies=true will the n side be a
> collection proxy?

yep!

> The problem i have is if i make this property
> forceProxies=true every relationship of the main object looked up is a
> proxy(and i don't want this behaviour for 1:1). Does this setting improve
> performance? or if i defined proxy classes or collection proxy in my
> repository_user will be behaviour be same?

Instead of using the cache forceProxies=true setting you can manage the 
the proxy creation more fine grained using the "proxy" attribute in 
reference-descriptor and collection-descriptor.

> That is
> if in Class A - Class B(1:n) ,A is looked up from cache, I want to know ifl
> the objects in relationship "rel" be materialized,? 
> if I use
> forceProxies=false and the definition in repository_user.xml is something
> like below
> 
> <class-descriptor class="ClassA">
> <field-descriptor...../>
> .....
> <collection-descriptor name="rel" collection-class="ManageableArrayList"
> element-class-ref="ClassB" proxy="true">
> <inverse-foreign field-ref="bpk"/>
> </collection-descriptor>
> </class-descriptor>

No, in this case the proxy is used too. The "forceProxies=true" 
attribute only forces the use of proxies, if 'false' the settings in 
reference/collection-descriptor is used.
http://db.apache.org/ojb/docu/guides/objectcache.html#ObjectCacheTwoLevelImpl

regards,
Armin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.