UnlockNotifyHandler

UnlockNotifyHandler that can be used when SQLite is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY, and when the library is built with -version=SqliteFakeUnlockNotify.. It retries the statement execution for the provided amount of time before the SQLITE_LOCKED is returned.

Use setUnlockNotifyHandler method to handle the database lock.

  1. class UnlockNotifyHandler
  2. class UnlockNotifyHandler

Constructors

this
this(Duration max = 1000.msecs)

Constructor

Members

Functions

reset
void reset()

Resets the handler for the next use

waitOne
void waitOne()

Blocks for some time to retry the statement

Properties

result
int result [@property getter]

Result after wait is finished

Inherited Members

From IUnlockNotifyHandler

wait
void wait()

Blocks until emit is called

emit
void emit(int state)

Unlocks the handler. This is called from registered callback from SQLite.

waitOne
void waitOne()

This is used as an alternative when SQLite is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY, and when the library is built with -version=SqliteFakeUnlockNotify. Using this, the handler tries to wait out the SQLITE_LOCKED state for some time. Implementation have to block for some amount of time and check if total amount is not greater than some constant afterwards. If there is still some time to try again, the handler must set the result to SQLITE_OK or to SQLITE_LOCKED otherwise.

reset
void reset()

Resets the handler for the next use

result
int result [@property getter]

Result after wait is finished

See Also

Meta