Page 1 of 1

SELECT FOR UPDATE

Posted: Mon 07 Apr 2014 13:56
by hepek
hi,

I have devart dotconnect 7.7.267. is there any settings, or any other way to make all updates act like "SELECT FOR UPDATE NOWAIT"?

in another words - every time we have dc.SubmitChanges dotConnect would check if the record is locked and return error right away, rather then wait for a long period of time until lock gets released.

thank you

Re: SELECT FOR UPDATE

Posted: Wed 09 Apr 2014 09:09
by MariiaI
You can try performing your scenario via the ExecureQuery method.
For example:

Code: Select all

Context.DataContext ctx = new Context.DataContext() { Log = Console.Out };
string sql = "select * from DEPT where DEPTNO = 1 FOR UPDATE nowait"; // select what you need
DEPT entity = ctx.ExecuteQuery<DEPT>(sql).FirstOrDefault();
entity.DNAME = "new name";
ctx.SubmitChanges();
Please tell us if this helps.

Re: SELECT FOR UPDATE

Posted: Wed 09 Apr 2014 13:29
by hepek
thank you for your response.

I was hoping there is a way to do this with straight LINQ, without using inline SQL.

perhaps I should build an extension method or something.

thanks

Re: SELECT FOR UPDATE

Posted: Thu 10 Apr 2014 10:36
by MariiaI
We are sending you a sample project, which demonstrates a possible way to implement your scenario, to the e-mail address you have provided in your forum profile. Please check that the letter is not blocked by your mail filter.

Please tell us if this helps.

Re: SELECT FOR UPDATE

Posted: Thu 10 Apr 2014 13:34
by hepek
I received your email. thank you.