SELECT FOR UPDATE

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
hepek
Posts: 126
Joined: Thu 07 Jul 2011 13:59

SELECT FOR UPDATE

Post by hepek » Mon 07 Apr 2014 13:56

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

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: SELECT FOR UPDATE

Post by MariiaI » Wed 09 Apr 2014 09:09

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.

hepek
Posts: 126
Joined: Thu 07 Jul 2011 13:59

Re: SELECT FOR UPDATE

Post by hepek » Wed 09 Apr 2014 13:29

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

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: SELECT FOR UPDATE

Post by MariiaI » Thu 10 Apr 2014 10:36

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.

hepek
Posts: 126
Joined: Thu 07 Jul 2011 13:59

Re: SELECT FOR UPDATE

Post by hepek » Thu 10 Apr 2014 13:34

I received your email. thank you.

Post Reply