Skip Headers

# Using Java

Previous

Next

The `SessionEvent.PreReleaseExclusiveConnection` event listener gives you an opportunity to interact with the underlying database platform: for example, to perform any VPD-specific cleanup such as executing PL/SQL to delete VPD packages or context information.

Example: Session Event Listener for an Isolated Session illustrates a typical session event listener used to handle `preReleaseExclusiveConnection` events for an isolated session.

Session Event Listener for an Isolated Session

    class VPDEventListener extends SessionEventAdaptor{
        public void preReleaseExclusiveConnection(SessionEvent event){
            Session session event.getSession();
            // Make the Stored Procedure call for VPD to reset the Context Information
            session.executeNonSelectingSQL("StoreProcResetContext()");
        }
    }

To get the required user credentials, use `ClientSession` method `getConnectionPolicy` to get the associated `ConnectionPolicy`, and then use `ConnectionPolicy` method `getProperty`. The `ConnectionPolicy` associated with the `ClientSession` should contain all required user credentials (see "Configuring Connection Policy").

After you implement the required `SessionEventListener`, add it to the parent server session, from which you acquire your isolated client session. For more information, see "Configuring Session Event Listeners".