|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.db.FarragoDbStmtContextBase net.sf.farrago.db.FarragoDbStmtContext
public class FarragoDbStmtContext
FarragoDbStmtContext implements the FarragoSessionStmtContext
interface in terms of a
FarragoDbSession
.
Most non-trivial public methods on this class must be synchronized on the parent session; see superclass for details.
Field Summary | |
---|---|
private FarragoCompoundAllocation |
allocations
|
private FarragoSessionExecutableStmt |
executableStmt
|
private boolean |
isExecDirect
|
private int |
queryTimeoutMillis
query timeout in seconds, default to 0. |
private ResultSet |
resultSet
|
private FarragoSessionRuntimeContext |
runningContext
|
private long |
updateCount
|
private FarragoWarningQueue |
warningQueue
|
Fields inherited from class net.sf.farrago.db.FarragoDbStmtContextBase |
---|
cancelFlag, childrenStmtContexts, daemon, dynamicParamDefs, dynamicParamValues, dynamicParamValuesSet, paramDefFactory, rootStmtContext, saveFirstCsn, session, snapshotCsn, sql, tracer |
Constructor Summary | |
---|---|
FarragoDbStmtContext(FarragoDbSession session,
FarragoSessionStmtParamDefFactory paramDefFactory,
FarragoDdlLockManager ddlLockManager)
Creates a new FarragoDbStmtContext object. |
|
FarragoDbStmtContext(FarragoDbSession session,
FarragoSessionStmtParamDefFactory paramDefFactory,
FarragoDdlLockManager ddlLockManager,
FarragoSessionStmtContext rootStmtContext)
Creates a new FarragoDbStmtContext object. |
Method Summary | |
---|---|
void |
cancel()
Cancels execution. |
private void |
cancel(boolean wait)
|
void |
closeResultSet()
Closes any result set associated with this statement context. |
void |
execute()
Executes the currently prepared statement. |
private void |
executeImpl()
|
private void |
finishPrepare()
|
private List<String> |
getDmlTarget()
|
RelDataType |
getPreparedParamType()
|
RelDataType |
getPreparedRowType()
|
int |
getQueryTimeout()
|
ResultSet |
getResultSet()
|
long |
getUpdateCount()
Obtains an update count produced by execute(), clearing this information as a side effect. |
FarragoWarningQueue |
getWarningQueue()
Gets the warning queue for this statement. |
boolean |
isPrepared()
|
boolean |
isPreparedDml()
|
void |
kill()
Cancels execution and destroys the statement. |
void |
prepare(RelNode plan,
SqlKind kind,
boolean logical,
FarragoSessionPreparingStmt prep)
Prepares a query or DML statement (not DDL), provided as a query plan. |
void |
prepare(String sql,
boolean isExecDirect)
Prepares an SQL statement. |
void |
setQueryTimeout(int millis)
|
void |
unprepare()
Releases any resources (including result sets) associated with this statement context. |
private long |
updateRowCounts(List<Long> rowCounts,
FarragoSessionRuntimeContext runningContext)
Update catalog row counts |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.farrago.session.FarragoSessionStmtContext |
---|
addChildStmtContext, clearParameters, daemonize, getCancelFlag, getExecutingStmtInfo, getSession, getSql, getStmtCurrentTime, needToSaveFirstTxnCsn, saveFirstTxnCsn, setDynamicParam, setDynamicParam, setSaveFirstTxnCsn |
Methods inherited from interface org.eigenbase.util.ClosableAllocation |
---|
closeAllocation |
Field Detail |
---|
private long updateCount
private ResultSet resultSet
private FarragoSessionExecutableStmt executableStmt
private FarragoCompoundAllocation allocations
private FarragoSessionRuntimeContext runningContext
private final FarragoWarningQueue warningQueue
private boolean isExecDirect
private int queryTimeoutMillis
Constructor Detail |
---|
public FarragoDbStmtContext(FarragoDbSession session, FarragoSessionStmtParamDefFactory paramDefFactory, FarragoDdlLockManager ddlLockManager)
session
- the session creating this statementpublic FarragoDbStmtContext(FarragoDbSession session, FarragoSessionStmtParamDefFactory paramDefFactory, FarragoDdlLockManager ddlLockManager, FarragoSessionStmtContext rootStmtContext)
session
- the session creating this statementMethod Detail |
---|
public boolean isPrepared()
isPrepared
in interface FarragoSessionStmtContext
public boolean isPreparedDml()
isPreparedDml
in interface FarragoSessionStmtContext
public void prepare(String sql, boolean isExecDirect)
FarragoSessionStmtContext
prepare
in interface FarragoSessionStmtContext
sql
- text of statement to be preparedisExecDirect
- whether the statement is being prepared as part of
direct executionprivate void finishPrepare()
public void prepare(RelNode plan, SqlKind kind, boolean logical, FarragoSessionPreparingStmt prep)
FarragoSessionStmtContext
FarragoSessionStmtContext.prepare(String,boolean)
, the statement can be executed by FarragoSessionStmtContext.execute()
.
prepare
in interface FarragoSessionStmtContext
plan
- a query plan (ie a relational expression).kind
- SqlKind value that characterized the statement.logical
- true when the query plan is logical (needs to be
optimized), false when it is physical (already optimized).prep
- the FarragoSessionPreparingStatement that is managing the
query plan.public RelDataType getPreparedRowType()
getPreparedRowType
in interface FarragoSessionStmtContext
public RelDataType getPreparedParamType()
getPreparedParamType
in interface FarragoSessionStmtContext
public void setQueryTimeout(int millis)
setQueryTimeout
in interface FarragoSessionStmtContext
public int getQueryTimeout()
getQueryTimeout
in interface FarragoSessionStmtContext
public void execute()
FarragoSessionStmtContext
execute
in interface FarragoSessionStmtContext
private void executeImpl()
public ResultSet getResultSet()
getResultSet
in interface FarragoSessionStmtContext
public long getUpdateCount()
FarragoSessionStmtContext
getUpdateCount
in interface FarragoSessionStmtContext
public void cancel()
FarragoSessionStmtContext
cancel
in interface FarragoSessionStmtContext
private void cancel(boolean wait)
public void kill()
FarragoSessionStmtContext
kill
in interface FarragoSessionStmtContext
public void closeResultSet()
FarragoSessionStmtContext
closeResultSet
in interface FarragoSessionStmtContext
public void unprepare()
FarragoSessionStmtContext
unprepare
in interface FarragoSessionStmtContext
unprepare
in class FarragoDbStmtContextBase
public FarragoWarningQueue getWarningQueue()
FarragoSessionStmtContext
getWarningQueue
in interface FarragoSessionStmtContext
private long updateRowCounts(List<Long> rowCounts, FarragoSessionRuntimeContext runningContext)
rowCounts
- row counts returned by the DML operation
private List<String> getDmlTarget()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |