This section briefly summarizes how to create PowerBuilder components that interact with the EAServer Connection Manager. For detailed instructions on using cached connections in PowerBuilder, see the Application Techniques manual in the PowerBuilder documentation.
To make sure that your PowerBuilder components use a cached connection, first use EAServer Manager to verify that a matching cache is defined.
In your component, you can obtain cached database connections using standard PowerBuilder techniques for opening a connection. When you open a connection, EAServer’s PowerBuilder dispatcher checks whether a cache exists with matching values for user name, password, and connectivity library. If a matching cache exists, your component receives a connection from the cache. Likewise, when you use standard PowerBuilder techniques to close the connection, EAServer places it back in the cache for reuse.
For finer control over the use of connection caches, you can set the following DBParm settings before opening a connection:
Set the CacheName DBParm if you wish to identify a cache by name. This setting causes EAServer to retrieve connections from the cache with that name rather than looking for matching values for user name, password, and connectivity library. You cannot use this option if the “Enable cache by Name Access” option is not set for the cache in EAServer Manager.
Set the GetConnectionOption DBParm to control what happens if all connections in the cache are in use.
Set the ReleaseConnectionOption to control whether the released connection is closed and deallocated or placed back in the cache for reuse.
For information on these options, see the DBParm documentation in the PowerBuilder online help.
Copyright © 2005. Sybase Inc. All rights reserved. |