markrendle/Simple.Data — pull request #193 by SimonH (2012-05-24 11:34:42+00:00)
Title: Custom Query builders and update locking

Hi Mark,

We use Oracle and have a requirement that many workers be able to collect work from a single database table. In order to prevent workers from grabbing the same work item we intend to use a combination of transactions and the SELECT... FOR UPDATE syntax.

Unfortunately SQL Server and Oracle differ in their implementation of the update locking {SQL uses WITH (UPDLOCK)}

I've added general ForUpdate functionality to SimpleQuery and altered QueryBuilder.Build so that, in a similar way to ICustomInserter people can Export an ICustomQueryBuilder (which I have implemented for SQL Server but not SQL CE).

Also, by adding some overloaded constructors I can now create a CustomQueryBuilder with an database specific implementation of IFunctionNameConverter.

It is my intention (once these changes are included and published on Nuget) to update Simple.Data.Oracle so that it takes advantage of the new ForUpdate functionality.

Thanks,

Simon