|
View previous topic :: View next topic
|
| Author |
Message |
anjani33 Currently Banned New User
Joined: 16 Mar 2007 Posts: 9 Location: pune
|
|
|
|
Hi,
When we lock table & run the program which have cursor on that table.
At what time program gives error? i.e. at time of opening cursor or at time of fetching.
thank you. |
|
| Back to top |
|
 |
agkshirsagar
Active Member

Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
| Quote: |
Theory!
It depends on 'locktimeout' database configuration parameter. If this is set to -1 then second program (Cursor in this case ) will wait forever for the first program to release lock.
If it is set to a finite value then and if the desired lock is not acquired before the time interval specified elapses, the waiting application receives an error and the transaction requesting thelock is rolled back. |
|
|
| Back to top |
|
 |
vini_srcna
Active User

Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
The question was: When will the timeout/deadlock occur..?
OPEN or FETCH ..?
It would depend on how the cursor is defined and when you are supplying the values to the host variables. If you have supplied the values to the host variables of the WHERE clause before OPEN, then you should get timeout at OPEN statement.
I assume you have locked the table in EXCLUSIVE MODE.
If you have locked in SHARE mode and if you query is read only with UR isolation level, you will never get -911. In fact this is a huge concept. Manuals have a good documentation on this. |
|
| Back to top |
|
 |
|
|