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 Tino Schöllhorn <t....@plattform-gmbh.de> on 2008/02/04 09:16:20 UTC

Optimizing object materialization for 1:N relations

Hi,

we are using OJB-1.0.1 and evertything works fine. Now I have the 
following situation:

We have a security-mechanism which uses the classes ACL 
(AccessControlList) and ACLEntry. One ACL has many ACLEntries. Now  when 
using the standard OJB-Materialization methods OJB uses 2 SQLs to 
materialize on ACL. One for the ACL and one for the ACLEntry.

Because we have MANY of those ACLs I am curious if it is possible to 
overwrite the materialization-method so that just one SQL is used. I 
thought about using "Prefeteched Relationships" but I noticed that there 
are also 2 SQLs.

Any ideas or even example how I could achieve that?

Kind regards
Tino


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


Re: Optimizing object materialization for 1:N relations

Posted by Tino Schöllhorn <t....@plattform-gmbh.de>.
Hi,

so I will try that. Thanks for your reply.

With regards
Tino

Danilo Tommasina schrieb:
> Hi Tino,
> 
> I think he meant, that you can load several ACLs with one query and use 
> prefetched relationships for loading all depending ACLEntries for each 
> loaded ACL.
> Also in this case you will have only 2 Queries, but you will bulk load 
> several ACLs
> 
> Bye
> danilo
> 
> Tino Schöllhorn wrote:
>> Hi Armin,
>>
>> thanks for your reply. Do you think it would be worth a try to 
>> materialize our objects with pure SQL - but after initializing them to 
>> work with them with OJB?
>>
>> Thanks for your opinion.
>>
>> Regards
>> Tino
>>
>> Armin Waibel schrieb:
>>> Hi Tino,
>>>
>>> Tino Schöllhorn wrote:
>>>> Hi,
>>>>
>>>> we are using OJB-1.0.1 and evertything works fine. Now I have the 
>>>> following situation:
>>>>
>>>> We have a security-mechanism which uses the classes ACL 
>>>> (AccessControlList) and ACLEntry. One ACL has many ACLEntries. Now  
>>>> when using the standard OJB-Materialization methods OJB uses 2 SQLs 
>>>> to materialize on ACL. One for the ACL and one for the ACLEntry.
>>>>
>>>> Because we have MANY of those ACLs I am curious if it is possible to 
>>>> overwrite the materialization-method so that just one SQL is used. I 
>>>> thought about using "Prefeteched Relationships" but I noticed that 
>>>> there are also 2 SQLs.
>>>
>>> The "Prefeteched Relationships" is useful if you search for more than 
>>> one ACL, then OJB is able to reduce the queries to read the ACLEntries:
>>> http://db.apache.org/ojb/docu/guides/query.html#prefetched+relationships
>>> The upcoming version 1.0.5 use "Prefeteched Relationships" for all 
>>> 1:n relations.
>>>
>>>>
>>>> Any ideas or even example how I could achieve that?
>>>>
>>>
>>> Sorry no.
>>>
>>> regards,
>>> Armin
>>>
>>>> Kind regards
>>>> Tino
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: Optimizing object materialization for 1:N relations

Posted by Danilo Tommasina <dt...@risksys.com>.
Hi Tino,

I think he meant, that you can load several ACLs with one query and use prefetched relationships for loading all depending ACLEntries for each loaded ACL.
Also in this case you will have only 2 Queries, but you will bulk load several ACLs

Bye
danilo

Tino Schöllhorn wrote:
> Hi Armin,
> 
> thanks for your reply. Do you think it would be worth a try to 
> materialize our objects with pure SQL - but after initializing them to 
> work with them with OJB?
> 
> Thanks for your opinion.
> 
> Regards
> Tino
> 
> Armin Waibel schrieb:
>> Hi Tino,
>>
>> Tino Schöllhorn wrote:
>>> Hi,
>>>
>>> we are using OJB-1.0.1 and evertything works fine. Now I have the 
>>> following situation:
>>>
>>> We have a security-mechanism which uses the classes ACL 
>>> (AccessControlList) and ACLEntry. One ACL has many ACLEntries. Now  
>>> when using the standard OJB-Materialization methods OJB uses 2 SQLs 
>>> to materialize on ACL. One for the ACL and one for the ACLEntry.
>>>
>>> Because we have MANY of those ACLs I am curious if it is possible to 
>>> overwrite the materialization-method so that just one SQL is used. I 
>>> thought about using "Prefeteched Relationships" but I noticed that 
>>> there are also 2 SQLs.
>>
>> The "Prefeteched Relationships" is useful if you search for more than 
>> one ACL, then OJB is able to reduce the queries to read the ACLEntries:
>> http://db.apache.org/ojb/docu/guides/query.html#prefetched+relationships
>> The upcoming version 1.0.5 use "Prefeteched Relationships" for all 1:n 
>> relations.
>>
>>>
>>> Any ideas or even example how I could achieve that?
>>>
>>
>> Sorry no.
>>
>> regards,
>> Armin
>>
>>> Kind regards
>>> Tino
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: Optimizing object materialization for 1:N relations

Posted by Tino Schöllhorn <t....@plattform-gmbh.de>.
Hi Armin,

thanks for your reply. Do you think it would be worth a try to 
materialize our objects with pure SQL - but after initializing them to 
work with them with OJB?

Thanks for your opinion.

Regards
Tino

Armin Waibel schrieb:
> Hi Tino,
> 
> Tino Schöllhorn wrote:
>> Hi,
>>
>> we are using OJB-1.0.1 and evertything works fine. Now I have the 
>> following situation:
>>
>> We have a security-mechanism which uses the classes ACL 
>> (AccessControlList) and ACLEntry. One ACL has many ACLEntries. Now  
>> when using the standard OJB-Materialization methods OJB uses 2 SQLs to 
>> materialize on ACL. One for the ACL and one for the ACLEntry.
>>
>> Because we have MANY of those ACLs I am curious if it is possible to 
>> overwrite the materialization-method so that just one SQL is used. I 
>> thought about using "Prefeteched Relationships" but I noticed that 
>> there are also 2 SQLs.
> 
> The "Prefeteched Relationships" is useful if you search for more than 
> one ACL, then OJB is able to reduce the queries to read the ACLEntries:
> http://db.apache.org/ojb/docu/guides/query.html#prefetched+relationships
> The upcoming version 1.0.5 use "Prefeteched Relationships" for all 1:n 
> relations.
> 
>>
>> Any ideas or even example how I could achieve that?
>>
> 
> Sorry no.
> 
> regards,
> Armin
> 
>> Kind regards
>> Tino
>>
>>
>> ---------------------------------------------------------------------
>> 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: Optimizing object materialization for 1:N relations

Posted by Armin Waibel <ar...@apache.org>.
Hi Tino,

Tino Schöllhorn wrote:
> Hi,
> 
> we are using OJB-1.0.1 and evertything works fine. Now I have the 
> following situation:
> 
> We have a security-mechanism which uses the classes ACL 
> (AccessControlList) and ACLEntry. One ACL has many ACLEntries. Now  when 
> using the standard OJB-Materialization methods OJB uses 2 SQLs to 
> materialize on ACL. One for the ACL and one for the ACLEntry.
> 
> Because we have MANY of those ACLs I am curious if it is possible to 
> overwrite the materialization-method so that just one SQL is used. I 
> thought about using "Prefeteched Relationships" but I noticed that there 
> are also 2 SQLs.

The "Prefeteched Relationships" is useful if you search for more than 
one ACL, then OJB is able to reduce the queries to read the ACLEntries:
http://db.apache.org/ojb/docu/guides/query.html#prefetched+relationships
The upcoming version 1.0.5 use "Prefeteched Relationships" for all 1:n 
relations.

> 
> Any ideas or even example how I could achieve that?
> 

Sorry no.

regards,
Armin

> Kind regards
> Tino
> 
> 
> ---------------------------------------------------------------------
> 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