Batching

Posts   
 
    
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 15-Mar-2007 09:57:16   

Hi,

Why doesn't LLBLGen allow me to send multiple queries to the db within a single batch?

Cheers, Ian.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Mar-2007 10:30:59   

What do you mean by a single batch? Have you checked out the Unit Of Work object in LLBLGen Pro?

Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 15-Mar-2007 12:58:19   

Hi,

When the doc says that all of the unit of work stuff is done upon a single call, is that a single call to the db or just a single call to the unit of work object?

In other words, does all the sql get sent to the db server in one go as if it was all inside a single sp or does one sql statement get sent, a response recevied, the next statement sent and so on?

Cheers, Ian.

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 15-Mar-2007 14:11:45   

i believe it means all the actions are done within a single connection. so the internal workings of UOW would look like this

try
{
     adapter.keep connection open = true
     adatper.open
     adatper.start transaction

     insert new entitygraph(s)
     update existing entitygraph(s)
     delete existing entitygraph(s)

     adapter.commit
}
catch
{
     adapter.rollback
     throw error
}
finally
{
     adatper.close
     adapter.dispose
}
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Mar-2007 14:30:44   

Yes Jason is right. Actions is sent to the SQL server in one Transaction, but not in one batch (as in a batch file). Which won't make any difference.