specifying NOLOCK

Posts   
 
    
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 24-Jan-2006 15:35:48   

When calling a typed view, is there a way to specify the NOLOCK statement?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 24-Jan-2006 15:59:45   

Only as a global setting. It has to be done directly on the SqlServerDQE, the DynamicQueryEngine has a static parameter which allows you to specify a NOLOCK hint for every select. See teh reference manual for details. This isn't ideal, but there's no other way.

Btw, nolocks in selects can sometimes be avoided if the select is in the same transaction as the updates to avoid deadlocks.

Frans Bouma | Lead developer LLBLGen Pro