Skip Headers

# Acquiring a Client Session That Does Not Use Lazy Connection Allocation

Previous

Next

By default, the server session does not allocate a data source connection for a client session until a transaction starts (a lazy data source connection). Alternatively, you can acquire a client session that allocates a connection immediately.

Example: Acquiring a Client Session that Does Not Use Lazy Connections illustrates how to configure a `ConnectionPolicy` to specify that lazy connection allocation is not used.

Acquiring a Client Session that Does Not Use Lazy Connections

    ConnectionPolicy connectionPolicy = new ConnectionPolicy();
    connectionPolicy.setIsLazy(false);
    Session clientSession = server.acquireClientSession(connectionPolicy);

For more information, see "Configuring Connection Policy".