Search in sources :

Example 1 with Response

use of org.firebirdsql.gds.ng.wire.Response in project jaybird by FirebirdSQL.

the class V11Statement method free.

@Override
protected void free(final int option) throws SQLException {
    synchronized (getSynchronizationObject()) {
        try {
            doFreePacket(option);
            /*
                 Don't flush close of cursor, only flush drop or unprepare of statement.
                 This balances network efficiencies with preventing statements
                 retaining locks on metadata objects too long
                */
            if (option != ISCConstants.DSQL_close) {
                getXdrOut().flush();
            }
            // process response later
            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();
        }
    }
}
Also used : DeferredAction(org.firebirdsql.gds.ng.wire.DeferredAction) Response(org.firebirdsql.gds.ng.wire.Response) WarningMessageCallback(org.firebirdsql.gds.ng.WarningMessageCallback) FbExceptionBuilder(org.firebirdsql.gds.ng.FbExceptionBuilder) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 FbExceptionBuilder (org.firebirdsql.gds.ng.FbExceptionBuilder)1 WarningMessageCallback (org.firebirdsql.gds.ng.WarningMessageCallback)1 DeferredAction (org.firebirdsql.gds.ng.wire.DeferredAction)1 Response (org.firebirdsql.gds.ng.wire.Response)1