CURSOR with "FOR UPDATE OF"
Posted: Mon Aug 31, 2015 5:04 pm
Hello All,
I'm not sure that I'm raising this question in correct Topic section or Not. But it's related to little bit COBOL logic.
Here is the scenerio-
1-I have declared the Cursor "TEST_CUR" with "FOR UPDATE OF ... Few Table column" NOTE: NO Table Join. just one table in this operation and putting PAGE LOCK in this cursor.
2-Opened the Cursor "TEST_CUR" on basis of Account No: 00001.
3-Fetched the information in different variables
4-Did some business logic but NO UPDATES for those columns which are locked with "FOR UPDATE OF"
5-For some conditions I Closed the Cursor "TEST_CUR"
first question here: are the rows are free now what were locked?
6- Opened the same cursor "TEST_CUR" again for same "Account no. 00001" and fetched the information
7- Did some different Business Logic which is differnt from 1st business logic.
8- Updated the Fields what are under "CURRENT OF TEST_CUR"
9-Closed the cursor "TEST_CUR".
Here I'm re-fetching the Cursor only in special scenarion NOT for all.
I have question here that when I did close the cursor first time then all the rows are freed from Lock or Not?? Cursor was opend in Page lock with Cursor stability.
Please let me know if any informmation is missing here.
Thanks,
Dhiraj.
I'm not sure that I'm raising this question in correct Topic section or Not. But it's related to little bit COBOL logic.
Here is the scenerio-
1-I have declared the Cursor "TEST_CUR" with "FOR UPDATE OF ... Few Table column" NOTE: NO Table Join. just one table in this operation and putting PAGE LOCK in this cursor.
2-Opened the Cursor "TEST_CUR" on basis of Account No: 00001.
3-Fetched the information in different variables
4-Did some business logic but NO UPDATES for those columns which are locked with "FOR UPDATE OF"
5-For some conditions I Closed the Cursor "TEST_CUR"
first question here: are the rows are free now what were locked?
6- Opened the same cursor "TEST_CUR" again for same "Account no. 00001" and fetched the information
7- Did some different Business Logic which is differnt from 1st business logic.
8- Updated the Fields what are under "CURRENT OF TEST_CUR"
9-Closed the cursor "TEST_CUR".
Here I'm re-fetching the Cursor only in special scenarion NOT for all.
I have question here that when I did close the cursor first time then all the rows are freed from Lock or Not?? Cursor was opend in Page lock with Cursor stability.
Please let me know if any informmation is missing here.
Thanks,
Dhiraj.