Network round trips

Posts   
 
    
rracer99
User
Posts: 58
Joined: 11-Mar-2007
# Posted on: 22-Mar-2010 17:17:33   

When using adapter and fetching an entity collection with many prefetch paths, is LLBLGEN making several network round trips?

I need to understand how many network round trips LLBLGEN is making to the database and back during FetchCollection (and fetch entity) calls, particularily when prefetch paths are used.

Thank you

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 22-Mar-2010 17:22:03   

One query per each prefetchPath.

if you fetching Customers and their Orders --> 2 Queries.

rracer99
User
Posts: 58
Joined: 11-Mar-2007
# Posted on: 22-Mar-2010 18:01:55   

Does each new query wait for the previous query to complete before being sent? Are these queries sent in parallel?

i.e. Customers query is sent, returns, then Orders query is sent, returns, etc?

or

Customers query is sent, Orders query is sent, then the queries are returned in whatever order they are returned in?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 22-Mar-2010 18:41:17   

after each other, so query 1 is sent, results are consumed, results are used for building the next query, query is sent etc. The parent results are necessary for building the other queries, so it can't be done in parallel.

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 22-Mar-2010 19:06:19   

There is an outstanding request to optionally run multiple branches of a prefetch tree in parallel when possible. customer -> shipping orders; customer -> purchase orders. Both types of orders could be fetched at the same time, at the cost of an additional connection to the db.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 22-Mar-2010 19:23:53   

arschr wrote:

There is an outstanding request to optionally run multiple branches of a prefetch tree in parallel when possible. customer -> shipping orders; customer -> purchase orders. Both types of orders could be fetched at the same time, at the cost of an additional connection to the db.

Correct. Whether it's doable internally though is another story, as a prefetch path on an adapter for example is executed with the connection of that adapter, it can't branch out to another connection (with all the mess of transaction management that comes with it). Merging across multiple cores is also on the list btw.

Frans Bouma | Lead developer LLBLGen Pro