GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • V15 Documentation
  • Privacy Statement
  • License Agreement
  • Contact Us

This view

  • Original page
  • New address

GeezerVison is showing docs.voltdb.com — B.4. Closing the Connection

  • Volt Active Data
  • Developer Hub
  • Books
    • VoltDB Tutorial
    • Using VoltDB
    • VoltDB Guide to Performance and Customization
    • VoltDB Administrator's Guide
    • Volt Kubernetes Administrator's Guide
    • VoltDB Quick Reference
  • Current docs ▶
  • VoltDB V15
    • VoltDB V16
    • VoltDB V15.3 LTS
    • VoltDB V14.3 LTS
    • VoltDB V13.3 LTS
    • VoltDB V12.3 LTS
    • VoltDB V11.4
    • VoltDB V10.2
    • VoltDB V9.3
B.4. Closing the Connection

Upgrade Guide

  • Preface▶
    • 1. Structure of This Book
    • 2. Related Documents
  • 1. Software Releases and Long-Term Support (LTS)▶
    • 1.1. The Software Release Schedule
    • 1.2. Staying Current
  • 2. The Software Upgrade Process▶
    • 2.1. Preparing for the Upgrade
    • 2.2. Upgrading Volt Databases on Managed Servers
      • 2.2.1. Upgrading the VoltDB Software
      • 2.2.2. Upgrading VoltDB Using Save and Restore
      • 2.2.3. Performing an In-Service Upgrade of a Single Cluster
      • 2.2.4. Performing an Online Upgrade Using Multiple XDCR Clusters
    • 2.3. Upgrading Volt in Kubernetes
      • 2.3.1. Updating Your Helm Repository
      • 2.3.2. Updating the Custom Resource Definition (CRD)
      • 2.3.3. Upgrading the VoltDB Operator and Software
      • 2.3.4. Using In-Service Upgrade to Update the VoltDB Software
      • 2.3.5. Updating VoltDB for XDCR Clusters
  • 3. Upgrading to Volt Active Data V8▶
    • 3.1. What's New in Volt V8.0
    • 3.2. Special Considerations for Existing Customers
  • 4. Upgrading to Volt Active Data V9▶
    • 4.1. What's New in Volt V9.0
    • 4.2. Special Considerations for Existing Customers
  • 5. Upgrading to Volt Active Data V10▶
    • 5.1. What's New in Volt V10.0
    • 5.2. Special Considerations for Existing Customers
  • 6. Upgrading to Volt Active Data V11▶
    • 6.1. What's New in Volt V11.0
    • 6.2. Special Considerations for Existing Customers
  • 7. Upgrading to Volt Active Data V12▶
    • 7.1. What's New in Volt V12.0
    • 7.2. Special Considerations for Existing Customers
  • 8. Upgrading to Volt Active Data V13▶
    • 8.1. What's New in Volt V13
    • 8.2. Special Considerations for Existing Customers
  • 9. Upgrading to Volt Active Data V14▶
    • 9.1. What's New in Volt Active Data V14
    • 9.2. Special Considerations for Existing Customers
  • 10. Upgrading to Volt Active Data V15▶
    • 10.1. What's New in Volt Active Data V15
    • 10.2. Special Considerations for Existing Customers
  • A. Configuration File (deployment.xml)▶
    • A.1. Understanding XML Syntax
    • A.2. The Structure of the XML Configuration File
  • B. Using the Original VoltDB Client Interface▶
    • B.1. Connecting to the VoltDB Database
      • B.1.1. Connecting to Multiple Servers
      • B.1.2. Using the Auto-Connecting Client
    • B.2. Invoking Stored Procedures
    • B.3. Invoking Stored Procedures Asynchronously
    • B.4. Closing the Connection
    • B.5. Handling Errors
      • B.5.1. Interpreting Execution Errors
      • B.5.2. Handling Timeouts
      • B.5.3. Writing a Status Listener to Interpret Other Errors

B.4. Closing the Connection

When the client application is done interacting with the VoltDB database, it is a good practice to close the connection. This ensures that any pending transactions are completed in an orderly way. The following example demonstrates how to close the client connection:

try {
    client.drain();
    client.close();
} catch (InterruptedException e) {
    e.printStackTrace();
}

There are two steps to closing the connection:

  1. Call drain() to make sure all asynchronous calls have completed. The drain() method pauses the current thread until all outstanding asynchronous calls (and their callback procedures) complete. This call is not necessary if the application only makes synchronous procedure calls. However, there is no penalty for calling drain() and so it can be included for completeness in all applications.

  2. Call close() to close all of the connections and release any resources associated with the client.

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.