Database Reference
In-Depth Information
One of the nice things about heavy-weight OCI connections is that they can report the terminal
name. Notice also that in the OS_USER parameter the OCI connection reports the domain name. It may
be that you can implement some additional security checks based on those identity traits.
Close the Proxy Session
Our proxy connection close method, in this context, closes the proxy session and returns the connection
to the pool for reuse. Notice in Listing 8-13 that we pass the PROXY_SESSION constant value to the
OracleConnection.close() method. This is identical to how we close the proxy connection without
connection pooling, except without pooling both the proxy session and the Oracle connection get
closed.
Listing 8-13. Close Proxy Connection
conn.close( OracleConnection.PROXY_SESSION );
Review All the Pool Properties
We can examine all the properties that are used by the connection pool, even those properties that we
did not explicitly set. The code in Listing 8-14 gets the complete list of configuration properties and
prints each key/value pair.
Listing 8-14. Display all OCI Connection Pool Properties
prop = cpool.getPoolConfig();
Enumeration enumer = prop.propertyNames();
String key;
while( enumer.hasMoreElements() ) {
key = (String)enumer.nextElement();
System.out.println( key + ", " + prop.getProperty( key ) );
}
We see the following list as the result from that code:
connpool_active_size, 0
connpool_pool_size, 2
connpool_max_limit, 10
connpool_min_limit, 2
connpool_timeout, 0
connpool_is_poolcreated, true
connpool_increment, 1
connpool_nowait, false
Summary of the OCI Connection Pool
The OCI connection pool handles our single sign-on approach very well. We are able to verify the user,
pass our secure application role procedure tests and access HR data.
Our OracleConnection class from an OCI connection pool does not recognize the proxy session, but
a proxy session exists nonetheless.
 
Search WWH ::




Custom Search