SELECT FOR UPDATE clause is being ignored when using SQL(DBMAN=ADO) directive
Customer is converting from a Server Express native application using Oracle's Pro*COBOL precompiler to Visual COBOL for Visual Studio managed code using OpenESQL with Oracles ADO Provider.
They are using both cursor fetches and singleton SELECT INTO statements that specify the FOR UPDATE and FOR UPDATE NOWAIT clauses.
When this is used with Pro*COBOL the FOR UPDATE clause causes a lock to be placed on rows when they are fetched from a cursor and also on a SELECT INTO statement. The locks are held until the next fetch or select INTO is executed.
Likewise if the FOR UPDATE NOWAIT clause is used then a sqlcode of -54 will be returned when attempting to fetch or select a row which is currently locked.
When using these constructs in Visual COBOL using DBMAN=ADO with Oracle ODP.NET Provider it seems that these clauses are being ignored and no locking of any kind is being done.
How can this be remedied?
The FOR UPDATE and NOWAIT clauses were being stripped off by the OpenESQL precompiler so that they would not be part of the underlying statement passed to the database at run-time.
This problem will be fixed in Visual COBOL 2.2.