Using cached connections in PowerBuilder components  Chapter 27: Creating Entity Components

Chapter 26: Using Connection Management

Connection Manager guidelines

This section explains Connection Manager guidelines.

Avoiding results-pending errors

You must be careful not to release a connection that has unprocessed command results associated with it. Any time you send a command using a cached connection, you must completely process the results of the command before releasing the connection for reuse. Failure to process all results will cause errors in the next component that uses the connection.

Connections and cache handles

Never release a connection into a cache other than the one in which it was created. If you follow the coding conventions illustrated in the examples, this issue should not be a problem.

Do not release a connection twice—this can cause unexpected problems.

Maintaining connection state

The connection’s server name, user name, and password are fixed when the cache is established. However, other connection properties can be changed dynamically when the connection is opened. For example:

Follow these guidelines to avoid problems with inconsistent connection state:

Copyright © 2005. Sybase Inc. All rights reserved. Chapter 27: Creating Entity Components