GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.voltdb.com — 6.3. Invoking Stored Procedures Asynchronously Documentation6.3. Invoking Stored Procedures AsynchronouslyCalling stored procedures synchronously simplifies the program logic because your client application waits for the procedure to complete before continuing. However, for high performance applications looking to maximize throughput, it is better to queue stored procedure invocations asynchronously. Asynchronous InvocationTo invoke stored procedures asynchronously, use the client.callProcedure(new MyCallback(),
"NewCustomer",
firstname,
lastname,
custID};The following are other important points to note when making asynchronous invocations of stored procedures:
Callback ImplementationThe callback procedure ( static class MyCallback implements ProcedureCallback {
@Override
public void clientCallback(ClientResponse clientResponse) {
if (clientResponse.getStatus() != ClientResponse.SUCCESS) {
System.err.println(clientResponse.getStatusString());
} else {
myEvaluateResultsProc(clientResponse.getResults());
}
}
}The callback procedure is passed the same The VoltDB Java client is single threaded, so callback procedures are processed one at a time. Consequently, it is a good practice to keep processing in the callback to a minimum, returning control to the main thread as soon as possible. If more complex processing is required by the callback, creating a separate thread pool and spawning worker methods on a separate thread from within the asynchronous callback is recommended. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |