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_GROUP table.

  • The ALTER CACHE GROUP SET AUTOREFRESH statement updates the cache group state in the SYS.CACHE_GROUP table.

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 ttLockWait built-in procedure.

  • Stop the cache agent before executing the ALTER CACHE GROUP SET AUTOREFRESH statement to modify the autorefresh mode, state, or interval.

    The following is a TimesTen Classic example that demonstrates setting the autorefresh state to paused.

    1. Stop the cache agent.

      Command> call ttCacheStop;
      
    2. 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;
      
    3. 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 the ttLockWait built-in procedure, see ttLockWait in the Oracle TimesTen In-Memory Database Reference.