Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

SELECT FOR UPDATE clause is being ignored when using SQL(DBMAN=ADO) directive

SELECT FOR UPDATE clause is being ignored when using SQL(DBMAN=ADO) directive

Problem:

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?

Resolution:

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.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-07-09 15:13
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.