Pessimistic locking with RepeatableRead ?
Posted: Thu 25 Aug 2011 09:28
I tried the following, to enforce pessimistic locking:
I expectet, that this generates a select for update in oracle, but the "for update"-Clause is missing. What is going wrong ?
I am using Devart.Data.Oracle,Version=5.70.170.0.
Code: Select all
List orderLineIds = new List { 1441932, 1441933, 1441934, 1441935 };
using (TgwWcsDataContext dataContext = DataContextFactory.GetDataContext(this, true)) {
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.RepeatableRead}))
{
IQueryable existingOrderLines = from ol in dataContext.Orderlines
where orderLineIds.Contains(ol.OrderlineId)
select ol;
foreach (Orderline existingOrderLine in existingOrderLines.ToList())
{
existingOrderLine.ChangedOn = DateTime.Now;
dataContext.SubmitChanges();
}
ts.Complete();
}
}
I am using Devart.Data.Oracle,Version=5.70.170.0.