number of connection in DataSource

Discussion in 'Java' started by finecur, Nov 15, 2008.

  1. finecur

    finecur Guest

    Hi,

    I am using PostgreSQL and tomcat connection pool. I found a lot of
    lost connections in my applications. To debug this problem, I would
    like to know how many connections I have established in my application
    and how many are available in the pool. How can I get this
    information? I am using the DataSource API.

    To get a connection, I use myDataSource.getConnection();

    To close a connection, I use myConnection.close();

    Thank you very much.

    fm
    finecur, Nov 15, 2008
    #1
    1. Advertising

  2. finecur

    Arne Vajhøj Guest

    finecur wrote:
    > I am using PostgreSQL and tomcat connection pool. I found a lot of
    > lost connections in my applications. To debug this problem, I would
    > like to know how many connections I have established in my application
    > and how many are available in the pool. How can I get this
    > information? I am using the DataSource API.
    >
    > To get a connection, I use myDataSource.getConnection();
    >
    > To close a connection, I use myConnection.close();


    Getting information out of the pool will require you
    to sniff around inside the connection pools internal
    structures.

    I would attack it from the other side: are all connections
    opened, assigned to a local variable and closed in a finally
    block ?

    Arne
    Arne Vajhøj, Nov 15, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HalcyonWild
    Replies:
    2
    Views:
    913
    HalcyonWild
    Dec 19, 2005
  2. Daniel

    DataSource and Connection

    Daniel, Jul 15, 2006, in forum: Java
    Replies:
    1
    Views:
    341
  3. gbattine
    Replies:
    1
    Views:
    580
    Manish Pandit
    Sep 27, 2006
  4. pek
    Replies:
    1
    Views:
    357
    Tarkin
    Apr 27, 2007
  5. Saburo
    Replies:
    0
    Views:
    883
    Saburo
    Jun 27, 2008
Loading...

Share This Page