Topic
7 replies Latest Post - ‏2013-05-20T11:43:47Z by gas
EJA3_sara_ahmadi
EJA3_sara_ahmadi
35 Posts
ACCEPTED ANSWER

Pinned topic close in use connection in connection pool

‏2013-02-02T12:32:22Z |
Hello
We want to set a time out for in flight connections (i.e connections that are in use) in websphere application server connection pool, so long running connections are closed and returned back to connection pool, is it possible?
Thanks
Updated on 2013-02-27T08:04:33Z at 2013-02-27T08:04:33Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    37422 Posts
    ACCEPTED ANSWER

    Re: close in use connection in connection pool

    ‏2013-02-02T22:46:15Z  in response to EJA3_sara_ahmadi
    From Admin Console > Data Sources > {Data Source} > Connection Pool Properties

    Modify,
    • Connection Time Out: Specifies the number of seconds that a connection request remains active.

    • Unused Timeout: Specifies the maximum number of seconds that an idle connection can remain in the pool before being discarded by the maintenance thread.

    • Aged Timeout: Specifies the interval, in seconds, after which an unused, aged connection is discarded (regardless of recent activity) by the pool maintenance thread.

    Try to discard connection before the Unused timeout, because you can get "Connection is Closed" exceptions. For best results, we use

    Connection Timeout: 180
    Unused Timeout: 1800
    Aged Timeout: 1200

    Hope this helps.
  • bpaskin
    bpaskin
    3831 Posts
    ACCEPTED ANSWER

    Re: close in use connection in connection pool

    ‏2013-02-05T12:26:44Z  in response to EJA3_sara_ahmadi
    Hi, you should be setting a timeout value on the Statement itself so that the connection does not stay open for too long. See http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout(int) . You can flush the pool, but not from the Admin Console. You will need to write a Jython/JACL script to purge the pool. Please see this example: http://www-01.ibm.com/support/docview.wss?uid=swg21220832 .

    Regards,
    Brian
  • SystemAdmin
    SystemAdmin
    37422 Posts
    ACCEPTED ANSWER

    Re: close in use connection in connection pool

    ‏2013-02-27T08:04:33Z  in response to EJA3_sara_ahmadi
    Hi,

    I would like to share my knowledge regarding connection pool

    Connection Timeout - specify the interval, in seconds , when a connection request times out. it will shows an error as (connection timeout exception)

    Max connections - Specify the maximum number of physical connections that can be created in pool.
    Min connections - Specify the minimum number of physical connections to be maintained.

    Reap time - Specify the interval , in seconds, between runs on pool maintainence and the thread.

    unused timeout - specify the interval , in seconds , when an unused or idle connection is discarded.

    Aged timeout - Specify the interval , in seconds , before a physical connection is discarded, regardless of recent usuage activity.

    Purge policy - Specify how to purge connections, when a stale or fatal connection error is detected.
  • HSDS43253
    HSDS43253
    2 Posts
    ACCEPTED ANSWER

    Re: close in use connection in connection pool

    ‏2013-05-20T11:07:32Z  in response to EJA3_sara_ahmadi

    Hi SystemAdmin,

    I'm sorry for asking a basic question. Can I set the "aged timeout" property using JMSAdmin tool? Or using MQ Explorer on Windows?

    I'm not sure we have AdminConsole up and running. Is it only avaiable for enterprise version?

     

    Thanks a lot.

    • gas
      gas
      881 Posts
      ACCEPTED ANSWER

      Re: close in use connection in connection pool

      ‏2013-05-20T11:15:11Z  in response to HSDS43253

      Hi,

      'Aged timeout' is set via WebSphere Application Server browser based administrative console.

      JMSAdmin tool and MQ Explorer are tools used with WebSphere MQ, not Application Server and you cannot set this timeout using these tools, as it is used by application server, not MQ.

       

      Gas