use of com.wplatform.ddal.command.CommandInterface in project jdbc-shards by wplatform.
the class JdbcStatement method cancel.
/**
* Cancels a currently running statement.
* This method must be called from within another
* thread than the execute method.
* Operations on large objects are not interrupted,
* only operations that process many rows.
*
* @throws SQLException if this object is closed
*/
@Override
public void cancel() throws SQLException {
try {
debugCodeCall("cancel");
checkClosed();
// executingCommand can be reset by another thread
CommandInterface c = executingCommand;
try {
if (c != null) {
c.cancel();
cancelled = true;
}
} finally {
setExecutingStatement(null);
}
} catch (Exception e) {
throw logAndConvert(e);
}
}
use of com.wplatform.ddal.command.CommandInterface in project jdbc-shards by wplatform.
the class JdbcConnection method setSavepoint.
/**
* Creates a new unnamed savepoint.
*
* @return the new savepoint
*/
@Override
public Savepoint setSavepoint() throws SQLException {
try {
int id = getNextId(TraceObject.SAVEPOINT);
if (isDebugEnabled()) {
debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint()");
}
checkClosed();
CommandInterface set = prepareCommand("SAVEPOINT " + JdbcSavepoint.getName(null, savepointId), Integer.MAX_VALUE);
set.executeUpdate();
JdbcSavepoint savepoint = new JdbcSavepoint(this, savepointId, null, trace, id);
savepointId++;
return savepoint;
} catch (Exception e) {
throw logAndConvert(e);
}
}
Aggregations