29 Mayıs 2009, Cuma
NOLOCK varlık Çerçevesi
Nasıl Varlık Çerçevesi üzerinde NOLOCK işlevini kullanabilir miyim? XML tek yolu bu.
CEVAP
23 EYLÜL 2009, ÇARŞAMBA
Hayır, ama bir hareketi başlatmak ve isolation level to read uncommited ayarlayabilirsiniz. Bu aslında NOLOCK olarak aynı işi yapar, ama başına bir tablo olarak bunu yapmak yerine, bu hareket kapsamında her şey için yap.
Eğer senin istediğin gibi görünüyorsa, bunu yapan hakkında nasıl gidebildin
//declare the transaction options
var transactionOptions = new System.Transactions.TransactionOptions();
//set it to read uncommited
transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted;
//create the transaction scope, passing our options in
using (var transactionScope = new System.Transactions.TransactionScope(System.Transactions.TransactionScopeOption.Required, transactionOptions))
//declare our context
using (var context = new MyEntityConnection())
{
//any reads we do here will also read uncomitted data
//...
//...
//don't forget to complete the transaction scope
transactionScope.Complete();
}
Bunu PaylaÅŸ:

Varlık Çerçevesi - "type 'Ka...
Varlık Çerçevesi - Kullanma İşlemleri ...
Devre dışı Varlık varsayılan olarak te...
Varlık Çerçevesi - türü Olamaz 'd...
Akıcı API ile benzersiz Kısıtlama Ayar...