Package com.foundationdb.sql.server

Examples of com.foundationdb.sql.server.ServerCallContextStack


    }
   
    @Override
    public ExecuteResults execute(EmbeddedQueryContext context, QueryBindings bindings) {
        bindings = setParameters(bindings, invocation);
        ServerCallContextStack stack = ServerCallContextStack.get();
        boolean success = false;
        stack.push(context, invocation);
        try {
            ExecuteResults results = super.execute(context, bindings);
            success = true;
            return results;
        }
        finally {
            stack.pop(context, invocation, success);
        }
    }
View Full Code Here


    }

    @Override
    public int execute(PostgresQueryContext context, QueryBindings bindings, int maxrows) throws IOException {
        bindings = PostgresLoadablePlan.setParameters(bindings, invocation);
        ServerCallContextStack stack = ServerCallContextStack.get();
        boolean success = false;
        stack.push(context, invocation);
        try {
            context.initStore(getSchema());
            int result = super.execute(context, bindings, maxrows);
            success = true;
            return result;
        }
        finally {
            stack.pop(context, invocation, success);
        }
    }
View Full Code Here

        int nrows = 0;
        DirectObjectCursor cursor = null;
        PostgresOutputter<List<?>> outputter = null;
        PostgresDirectObjectCopier copier = null;
        bindings = PostgresLoadablePlan.setParameters(bindings, invocation);
        ServerCallContextStack stack = ServerCallContextStack.get();
        boolean suspended = false, success = false;
        stack.push(context, invocation);
        try {
            context.initStore(schema);
            cursor = context.startCursor(this, bindings);
            switch (outputMode) {
            case TABLE:
                outputter = new PostgresDirectObjectOutputter(context, this);
                break;
            case COPY:
            case COPY_WITH_NEWLINE:
                outputter = copier = new PostgresDirectObjectCopier(context, this, (outputMode == DirectObjectPlan.OutputMode.COPY_WITH_NEWLINE));
                copier.respond();
                break;
            }
            if (cursor != null) {
                List<?> row;
                while ((row = cursor.next()) != null) {
                    if (row.isEmpty()) {
                        messenger.flush();
                    }
                    else {
                        outputter.output(row);
                        nrows++;
                    }
                    if ((maxrows > 0) && (nrows >= maxrows)) {
                        suspended = true;
                        break;
                    }
                }
            }
            if (copier != null) {
                copier.done();
            }
            success = true;
        }
        finally {
            suspended = context.finishCursor(this, cursor, nrows, suspended);
            stack.pop(context, invocation, success);
        }
        if (suspended) {
            messenger.beginMessage(PostgresMessages.PORTAL_SUSPENDED_TYPE.code());
            messenger.sendMessage();
        }
View Full Code Here

TOP

Related Classes of com.foundationdb.sql.server.ServerCallContextStack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.