|
SQLJet Home | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tmatesoft.sqljet.core.table.SqlJetDefaultBusyHandler
public class SqlJetDefaultBusyHandler
Implementation of SQLJet busy handlers. Used by default in SqlJetDb.
Performs some number of retries (by default 10 or SQLJET_BUSY_RETRIES system property value) per every time interval (by default 100 milliseconds or SQLJET_BUSY_SLEEP system property value in milliseconds).
Field Summary | |
---|---|
static java.lang.String |
SQLJET_BUSY_RETRIES_PROPERTY
Name of system property which defines retries count by default. |
static java.lang.String |
SQLJET_BUSY_SLEEP_PROPERTY
Name of system property which defines time wait by default. |
Constructor Summary | |
---|---|
SqlJetDefaultBusyHandler()
Creates busy handler with default parameters. |
|
SqlJetDefaultBusyHandler(int retries,
int sleep)
Creates busy handler with custom parameters. |
Method Summary | |
---|---|
boolean |
call(int number)
Callback which implements busy handler. |
int |
getRetries()
Returns number of attempts to make to lock database. |
int |
getSleep()
Returns sleep time interval in milliseconds between retries to lock database. |
boolean |
isCancel()
Check is busy handler to cancel. |
void |
setCancel(boolean cancel)
Allow cancel urgently busy retries. |
void |
setRetries(int retries)
Sets number of attempts to make to lock database. |
void |
setSleep(int sleep)
Sets sleep time interval in milliseconds between retries to lock database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SQLJET_BUSY_RETRIES_PROPERTY
public static final java.lang.String SQLJET_BUSY_SLEEP_PROPERTY
Constructor Detail |
---|
public SqlJetDefaultBusyHandler()
public SqlJetDefaultBusyHandler(int retries, int sleep)
retries
- number of retries to performsleep
- sleep time interval in milliseconds between retries to lock database.Method Detail |
---|
public int getRetries()
public void setRetries(int retries)
retries
- number of attempts.public int getSleep()
public void setSleep(int sleep)
sleep
- interval time in milliseconds.public void setCancel(boolean cancel)
cancel
- if true then busy handler will not wait.public boolean isCancel()
public boolean call(int number)
ISqlJetBusyHandler
Callback which implements busy handler.
To method call() is passed number of retry to obtain database lock. If
call() returns true then retries to locking still continue. If call()
returns false then will be thrown SqlJetException
with
SqlJetErrorCode.BUSY
.
call
in interface ISqlJetBusyHandler
number
- number of retry to obtain lock on database.
|
SQLJet Home | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |