Interface TdbPoolInitializer


  • public interface TdbPoolInitializer
    Declares an interface for a pool initialization procedure.

    The usage of a pool initializer turns a connection pool into a session pool. The difference is that in a session pool, the pool initializer opens databases to be used, sets up views, defines, etc. All things that need to done one time and does not have to be repeated for ever single request. This results in greater performance for the application using the pool.

    An alternative to using the TdbPoolInitializer is to use a server-side startup procedure. A startup procedure is registered with the user profile of a TRIP user. The use of server-side startup procedures will in most cases give somewhat better performance than using a client-side pool initialization procedure due to reduced network traffic.

    See Also:
    TdbConnectionPool.setPoolInitializer(TdbPoolInitializer)
    • Method Detail

      • initializePooledSession

        void initializePooledSession​(TdbPooledSession session)
                              throws TdbException
        Perform one-time initialization of a session when it is created by the pool. This method is called once for a pooled session, and always before the session can be acquired by an application.
        Parameters:
        session - Pooled session to initialize
        Throws:
        TdbException - If an error during initialization occurs.