users@glassfish.java.net

RE: UniversalConnectionPool Oracle RAC

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Mon, 21 Mar 2011 11:17:03 -0400

> To: users_at_glassfish.java.net
> Subject: UniversalConnectionPool Oracle RAC
> From: forums_at_java.net
> Date: Mon, 21 Mar 2011 09:02:22 -0500
>
> Hi all,
>
> I've breaking my head now for two days over how to create an Oracle Universal
> Connection Pool with Glassfish. The thing is, I can put a lot of properties
> in a normal Connection Pool, but I can't figure out how to add or create a
> custom Resource Type for the Connection Pool.
>
> There are 3 types visible, javax.sql.DataSource, javax.sql.XADataSource and
> javax.sql.ConnectionPoolDataSource. However, the UCP-type is
> oracle.ucp.jdbc.PoolDataSource.

MG>
the implementor of the PoolDataSource is the ConnectionFactoryAdapter illustrated here:
http://download.oracle.com/docs/cd/E16338_01/java.112/e12826/oracle/ucp/ConnectionFactoryAdapter.html
via createPooledConnection method

UniversalPooledConnection createPooledConnection(java.lang.Object connection,
                                                 ConnectionRetrievalInfo connectionRequestInfo)
                                                 throws UniversalConnectionPoolException

Creates a UniversalPooledConnection object.
Parameters:connection - The physical connection that this pooled connection decorates.connectionRequestInfo - The connection retrieval info object used to create the decorated connection.Returns:The created UniversalPooledConnection object.Throws:UniversalConnectionPoolException - if an error occurs creating the UniversalPooledConnection object.

where ConnectionRetrievalInfo input represents
"resource-specific information that the connection factory
adapter uses to create connections. For example, the JDBC connection
retrieval info object maintains the user and password that are used to
create a connection from a JDBC resource."

http://download.oracle.com/docs/cd/E16338_01/java.112/e12826/oracle/ucp/ConnectionRetrievalInfo.html

the returned UniversalPooledConnection object is defined as
"the actual object that is pooled by the connection pool. A UniversalPooledConnection decorates a physical connection that is produced by a resource (JDBC is an example of a resource). <p/> UniversalPooledConnection object's are borrowed from, and returned to, a connection pool. A UniversalPooledConnection
 can also be closed which means that it is not returned to the
connection pool and its associated physical connection is closed.
<p/> The heartbeat() method is used to update this
object so that the abandoned connection processing works properly. It is
 up to the client of the connection pool to call the heartbeat()
 method appropriately. <p/> The Connection Labeling mechanism is
application-driven. Labels can be applied on, and removed from, a
borrowed connection. Each connection label is defined as a key/value
pair. Connection labels are used for connection-matching purposes. Any
number of connection labels may be applied on a borrowed connection. It
is also possible to obtain all the labels currently applied on a
borrowed connection, as well as all the unmatched labels within
application-requested labels for each connection-borrowing request."

MG>

Can someone explain to me how I can create a
> custom entry and put all the properties that belong to a RAC connection pool
> in it? I'm kinda stuck here.
>
> Thanks!
>
>
> --
>
> [Message sent by forum member 'dijkmana']
>
> View Post: http://forums.java.net/node/783670
>
>