use of org.firebirdsql.gds.ng.wire.DeferredAction in project jaybird by FirebirdSQL.
the class V11Statement method free.
@Override
protected void free(final int option) throws SQLException {
synchronized (getSynchronizationObject()) {
try {
doFreePacket(option);
// intentionally no flush
getDatabase().enqueueDeferredAction(new DeferredAction() {
@Override
public void processResponse(Response response) {
processFreeResponse(response);
}
@Override
public WarningMessageCallback getWarningMessageCallback() {
return getStatementWarningCallback();
}
});
} catch (IOException ex) {
switchState(StatementState.ERROR);
throw new FbExceptionBuilder().exception(ISCConstants.isc_net_write_err).cause(ex).toSQLException();
}
}
}
use of org.firebirdsql.gds.ng.wire.DeferredAction in project jaybird by FirebirdSQL.
the class V11WireOperations method processDeferredActions.
@Override
public final void processDeferredActions() {
synchronized (getSynchronizationObject()) {
if (deferredActions.size() == 0)
return;
final DeferredAction[] actions = deferredActions.toArray(new DeferredAction[0]);
deferredActions.clear();
for (DeferredAction action : actions) {
try {
action.processResponse(readSingleResponse(action.getWarningMessageCallback()));
} catch (Exception ex) {
// This only happen if the connection is no longer available
// We ignore the exception and assume the next operation by the caller will fail as well
log.debug("Exception in processDeferredActions", ex);
}
}
}
}
Aggregations