Class Database.ExecuteQueryThread
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.manifoldcf.core.database.Database.ExecuteQueryThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- Database
protected class Database.ExecuteQueryThread extends java.lang.ThreadThread used to execute queries. An instance of this thread is spun up every time a query is executed. This is necessary because JDBC does not guarantee interruptability, and the Postgresql JDBC driver unfortunately eats all thread interrupts. So, we fire up a thread to do each interaction with the database server, thus insuring that the owning thread remains interruptable and will therefore not block shutdown.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanbResultsprotected java.sql.Connectionconnectionprotected java.lang.Throwableexceptionprotected intmaxResultsprotected java.util.Listparamsprotected java.lang.Stringqueryprotected ILimitCheckerreturnLimitprotected IResultSetrvalprotected ResultSpecificationspec
-
Constructor Summary
Constructors Constructor Description ExecuteQueryThread(java.sql.Connection connection, java.lang.String query, java.util.List params, boolean bResults, int maxResults, ResultSpecification spec, ILimitChecker returnLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IResultSetfinishUp()voidrun()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
connection
protected java.sql.Connection connection
-
query
protected java.lang.String query
-
params
protected java.util.List params
-
bResults
protected boolean bResults
-
maxResults
protected int maxResults
-
spec
protected ResultSpecification spec
-
returnLimit
protected ILimitChecker returnLimit
-
exception
protected java.lang.Throwable exception
-
rval
protected IResultSet rval
-
-
Constructor Detail
-
ExecuteQueryThread
public ExecuteQueryThread(java.sql.Connection connection, java.lang.String query, java.util.List params, boolean bResults, int maxResults, ResultSpecification spec, ILimitChecker returnLimit)
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
finishUp
public IResultSet finishUp() throws ManifoldCFException, java.lang.InterruptedException
- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
-