tibasSpaceDef_SetLockTTL()

Sets the number of milliseconds until locks on tuples in the space are automatically cleared.

Declaration

tibas_status tibasSpaceDef_SetLockTTL
(tibasSpaceDef spaceDef,
tibas_long      lockTTL)

Parameters

Parameter Description
spaceDef A spaceDef object that identifies the space for which to set the lock TTL.
lockTTL Number of milliseconds until the lock is automatically cleared.

The default is TIBAS_WAIT_FOREVER (-1).

Remarks

Use the tibasSpaceDef_SetLockTTL() function to specify an optional TTL value for locks that are placed on tuples in the space.

By default, unless you specify a lock TTL, tuples remain locked until the application that locked the tuple clears the lock, a lock wait time set by an application is reached, or the application disconnects from the metaspace.

To prevent possible deadlock scenarios, you can call tibasSpaceDefSetLockTTL() to specify a lock wait time. If an application does not clear a lock that it has placed on a tuple within the specified lock TTL period, the system automatically clears the lock.