I'm currently working on a system that uses COBOL to connect to DB2. A sample browse would be initiated by the following statement:
EXEC SQL
DECLARE <cursor name> CURSOR FOR
SELECT
<field names>
FROM <table name>
WHERE
<conditions>
ORDER BY
<key fields>
FOR FETCH ONLY
OPTIMIZE FOR 1 ROW
END-EXEC.
EXEC SQL
OPEN <cursor name>
END-EXEC.
Once the browse has been determined to be successful, succeeding reads on the table would be made using the following:
EXEC SQL
FETCH <cursor name>
INTO
<variable names>
END-EXEC.
If, for example, I'm browsing a table and the resultset returned is around 100,000 rows, that would take hours to process. This would be okay if I can ensure that other users of the system would not encounter deadlocks (-911) if they are processing on the same table that I am browsing (processing would mean selecting, updating and possibly deleting records).
How can I determine if the browse operation I am performing can potentially cause deadlocks for other users?
(NOTE: I'm not doing any updates, just purely retrieving data)