Package org.sqlite
Class BusyHandler
- java.lang.Object
-
- org.sqlite.BusyHandler
-
public abstract class BusyHandler extends java.lang.Object
https://www.sqlite.org/c3ref/busy_handler.html
-
-
Constructor Summary
Constructors Constructor Description BusyHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
callback(int nbPrevInvok)
https://www.sqlite.org/c3ref/busy_handler.htmlstatic void
clearHandler(java.sql.Connection conn)
Clears any busy handler registered with the connection.private static void
commitHandler(java.sql.Connection conn, BusyHandler busyHandler)
commit the busy handler for the connection.static void
setHandler(java.sql.Connection conn, BusyHandler busyHandler)
Sets a busy handler for the connection.
-
-
-
Method Detail
-
commitHandler
private static void commitHandler(java.sql.Connection conn, BusyHandler busyHandler) throws java.sql.SQLException
commit the busy handler for the connection.- Parameters:
conn
- the SQLite connectionbusyHandler
- the busyHandler- Throws:
java.sql.SQLException
-
setHandler
public static final void setHandler(java.sql.Connection conn, BusyHandler busyHandler) throws java.sql.SQLException
Sets a busy handler for the connection.- Parameters:
conn
- the SQLite connectionbusyHandler
- the busyHandler- Throws:
java.sql.SQLException
-
clearHandler
public static final void clearHandler(java.sql.Connection conn) throws java.sql.SQLException
Clears any busy handler registered with the connection.- Parameters:
conn
- the SQLite connection- Throws:
java.sql.SQLException
-
callback
protected abstract int callback(int nbPrevInvok) throws java.sql.SQLException
https://www.sqlite.org/c3ref/busy_handler.html- Parameters:
nbPrevInvok
- number of times that the busy handler has been invoked previously for the same locking event- Returns:
- If the busy callback returns 0, then no additional attempts are made to access the database and SQLITE_BUSY is returned to the application. If the callback returns non-zero, then another attempt is made to access the database and the cycle repeats.
- Throws:
java.sql.SQLException
-
-