Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.threetier
Class ConnectionPolicy

`java.lang.Object
oracle.toplink.threetier.ConnectionPolicy`

All Implemented Interfaces:
  java.lang.Cloneable, java.io.Serializable

public class ConnectionPolicy
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Purpose: Used to specify how a client session's should be allocated.

See Also:
  `ServerSession`, Serialized Form

Constructor Summary
`ConnectionPolicy()` PUBLIC: A connection policy is used to define how the client session connection should be acquired.
`ConnectionPolicy(Login login)` PUBLIC: A connection policy is used to define how the client session connection should be acquired.
`ConnectionPolicy(java.lang.String poolName)` PUBLIC: A connection policy is used to define how the client session connection should be acquired.

Method Summary
`void` | `dontUseLazyConnection()` PUBLIC: A lazy connection only acquires a physical connection when a transaction is started and releases the connection when the transaction completes.
`Login` | `getLogin()` PUBLIC: Return the login to use for this connection.
`java.lang.String` | `getPoolName()` PUBLIC: Return the pool name or null if not part of a pool.
`java.util.Map` | `getProperties()` ADVANCED: This method will return the collection of custom properties set on the Connection policy.
`java.lang.Object` | `getProperty(java.lang.Object object)` PUBLIC: Returns the property associated with the corresponding key.
`boolean` | `hasLogin()` PUBLIC: Return if a login is used, only one of login and pool can be used.
`boolean` | `hasProperties()` PUBLIC: Returns true if properties are available on the Connection Policy
`boolean` | `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.
`java.lang.Object` | `removeProperty(java.lang.Object key)` PUBLIC: This method is used to remove a custom property from the Connection Policy.
`void` | `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.
`void` | `setShouldUseExclusiveConnection(boolean useExclusiveConnection)` PUBLIC: If set to true the acquired client session should acquire an exclusive connection for all database interaction.
`boolean` | `shouldUseExclusiveConnection()` PUBLIC: Returns true if the acquired client session should acquire an exclusive connection for all database interaction.
`void` | `useLazyConnection()` PUBLIC: A lazy connection only acquires a physical connection when a transaction is started and releases the connection when the transaction completes.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ConnectionPolicy

    public ConnectionPolicy()

  PUBLIC: A connection policy is used to define how the client session connection should be acquired.

### ConnectionPolicy

    public ConnectionPolicy(java.lang.String poolName)

  PUBLIC: A connection policy is used to define how the client session connection should be acquired.

### ConnectionPolicy

    public ConnectionPolicy(Login login)

  PUBLIC: A connection policy is used to define how the client session connection should be acquired.

Method Detail

### dontUseLazyConnection

    public void dontUseLazyConnection()

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

### getLogin

    public Login getLogin()

  PUBLIC: Return the login to use for this connection. Client sessions support using a seperate user login for database modification.

### getPoolName

    public java.lang.String getPoolName()

  PUBLIC: Return the pool name or null if not part of a pool.

### getProperties

    public java.util.Map getProperties()

  ADVANCED: This method will return the collection of custom properties set on the Connection policy. Note that this will cause the lazy initialization of the HashMap.

### getProperty

    public java.lang.Object getProperty(java.lang.Object object)

  PUBLIC: Returns the property associated with the corresponding key. These properties will be available to connection events.

### hasLogin

    public boolean hasLogin()

  PUBLIC: Return if a login is used, only one of login and pool can be used.

### hasProperties

    public boolean hasProperties()

  PUBLIC: Returns true if properties are available on the Connection Policy

### isLazy

    public boolean 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.

### removeProperty

    public java.lang.Object removeProperty(java.lang.Object key)

  PUBLIC: This method is used to remove a custom property from the Connection Policy. This method will return the propery removed. If it was not found then null will be returned.

### setIsLazy

    public void 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.

### setLogin

    public void setLogin(Login login)

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

### setPoolName

    public void setPoolName(java.lang.String poolName)

  PUBLIC: Set the pool name or null if not part of a pool.

### setProperty

    public void setProperty(java.lang.Object key,
                            java.lang.Object property)

  PUBLIC: Use this method to set custom properties on the Connection Policy. These properties will be available from within connection events but have no effect on the connection directly.

### setShouldUseExclusiveConnection

    public void setShouldUseExclusiveConnection(boolean useExclusiveConnection)

  PUBLIC: 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.

### shouldUseExclusiveConnection

    public boolean shouldUseExclusiveConnection()

  PUBLIC: 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.

### 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD