Avoid a Lock Timeout Condition When Modifying Autorefresh
A lock timeout may occur if you modify the autorefresh mode, state, or interval with the ALTER CACHE GROUP statement at the same time when a scheduled autorefresh starts (scheduled because of the autorefresh interval).
-
Autorefresh locks the cache tables and its rows in the
SYS.CACHE_GROUPtable. -
The
ALTER CACHE GROUP SET AUTOREFRESHstatement updates the cache group state in theSYS.CACHE_GROUPtable.
This results in the following error:
Error TT6003: Lock request denied because of time-out.
As a workaround, you can:
-
Increase the lock timeout with the
ttLockWaitbuilt-in procedure. -
Stop the cache agent before executing the
ALTER CACHE GROUP SET AUTOREFRESHstatement to modify the autorefresh mode, state, or interval.The following is a TimesTen Classic example that demonstrates setting the autorefresh state to paused.
-
Stop the cache agent.
Command> call ttCacheStop;
-
Alter the autorefresh state to the desired state. This example sets the autorefresh state to paused.
Command> ALTER CACHE GROUP new_customers SET AUTOREFRESH STATE PAUSED;
-
Start the cache agent.
Command> call ttCacheStart;
For more information on
ALTER CACHE GROUP, see ALTER CACHE GROUP in the Oracle TimesTen In-Memory Database SQL Reference. For more information on thettLockWaitbuilt-in procedure, see ttLockWait in the Oracle TimesTen In-Memory Database Reference. -