Description: The ConnectionPolicy is used to indicate how a client
session will interact with the internal or external JDBC connection pool/data
source. The default ConnectionPolicy is held on the ServerSession but this
can be overridden for any specific client session when it is acquired.

isLazy()
PUBLIC:
Return if a lazy connection should be used, a lazy connection only acquire a physical connection
when a transaction is started and releases the connection when the transaction completes.

setIsLazy(boolean isLazy)
PUBLIC:
Set if a lazy connection should be used, a lazy connection only acquire a physical connection
when a transaction is started and releases the connection when the transaction completes.

void

setLogin(Login login)
PUBLIC:
Set the login to use for this connection.

void

setPoolName(java.lang.String poolName)
PUBLIC:
Set the pool name or null if not part of a pool.

void

setProperty(java.lang.Object key,
java.lang.Object property)
PUBLIC:
Use this method to set custom properties on the Connection Policy.

login

The login information used to create a JDBC connection or acquire one
from an external pool/data-source. Typically this is constant within a
single persistence unit but in some advanced usages users can customize
connections for each client session.

poolName

protected java.lang.String poolName

Name of the pool to be used.
If neither pool name nor login provided then default pool will be used.
If no pool name is provided but there's a login then the login is used to
create connection which the ClientSession will use.

isLazy

protected boolean isLazy

Determines if the write/exclusive connection is acquired only when first
requested (lazy, this is the default) or immediately when the client
session is acquired.
After write/exclusive connection is acquired
if isLazy is true and exclusiveMode is Transactional
then it's held until transaction is committed or rolled back,
otherwise until the client session is released.

setLogin

PUBLIC:
Set the login to use for this connection.
Client sessions support using a separate user login for database modification.
Pooled connections must use the pool's login and cannot define their own.

setShouldUseExclusiveConnection

OBSOLETE:
If set to true the acquired client session should acquire an exclusive connection
for all database interaction. Currently this is only supported with Isolated
data, but required for Oracle VPD support.
This method has been replaced with setExclusiveMode method:
true corresponds to ExclusiveMode.Isolated,
false - to ExclusiveMode.Transactional.

shouldUseExclusiveConnection

public boolean shouldUseExclusiveConnection()

Deprecated.

OBSOLETE:
Returns true if the acquired client session should acquire an exclusive connection
for all database interaction. Currently this is only supported with Isolated
data, but required for Oracle VPD support.
This method has been replaced with isExclusiveIsolated method.

toString

public java.lang.String toString()

INTERNAL:
return a string representation of this ConnectionPolicy

Overrides:

toString in class java.lang.Object

useLazyConnection

public void useLazyConnection()

PUBLIC:
A lazy connection only acquires a physical connection
when a transaction is started and releases the connection when the transaction completes.