0
트랜잭션 내에서 수행 된 데이터베이스 잠금이 해당 트랜잭션이 끝날 때 해제된다는 것은 잘 알려져 있습니다. 그래서,이 코드에서 .. 중첩 된 트랜잭션을 커밋 할 때 페이지 잠금이 해제됩니까?
public static TransactionScope CreateTransactionScope()
{
return new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions() { IsolationLevel = IsolationLevel.ReadCommitted });
}
사실이 하나
... 행/페이지 잠금 ( UPDLOCK)이 발표 될 예정 정확히using (DataContext dataContext = new DataContext())
using (TransactionScope rootScope = CreateTransactionScope())
{
using (TransactionScope nested = CreateTransactionScope())
{
Ticket ticket = dataContext.ExecuteQuery<Ticket>(
"SELECT * FROM Tickets WITH (UPDLOCK) WHERE id={0}", ticketId).First();
nested.Complete();
}
// Will the lock be still ON here? Because I don't need him to be!
}
- 배치 용 중첩 된 거래 후 또는 뿌리 하나?