batch load entities

Posts   
 
    
jspanoneo
User
Posts: 1
Joined: 15-Jul-2005
# Posted on: 15-Jul-2005 23:23:31   

What's the best way to batch load some non related entities?
For example, I have a web page. I know I need a memberentity, an orderentity and say a pastorderentity.

Since I know I need these exact 3 entities, can I batch them together somehow so it only round trips to the db once?

Is this possible, if so, how would I do it in both selfservice and adapter?

Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 16-Jul-2005 14:46:09   

batching 3 different results together can only be done if they have the same fieldset, so in theory 'union' can be used (in SQL).

Though, as the resultsets for all 3 entities are different I think, you have to have 3 resultsets. In adapter, you can win some speed by opening the connection manually, then fetch the 3 entities, then close the connection manually (important).

In selfservicing you have to fetch them one by one, though through connection pooling you lose 2 times 20ms.

Frans Bouma | Lead developer LLBLGen Pro