Skip to Content
avatar image
Former Member

Right way to configure Tomcat JDBC resource for MaxDB

Hi,

i need to configure one tomcat server with a pool of connections for a MaxDB instance with follow database parameters:

MAXUSERTASKS=150
SESSION_TIMEOUT=60

i do this configuration on tomcat:

<Resource name="jdbc/myApp"
                auth="Container"
                type="javax.sql.DataSource"
                username="DBUSER"
                password="secret"
                driverClassName="com.sap.dbtech.jdbc.DriverSapDB"
                url="jdbc:sapdb://dbserver/DBNAME"
                maxActive="150"
                maxIdle="75"
                validationQuery="SELECT NOW() FROM DBA.DUAL"/>

is this the right way? there is a way to check if the pool is working at database side? at java side i checked that the javax.sql.DataSource.loginTimeout is Unavailable, then what is the better way to avoid errors like:

2008-06-02 13:54:36  2165 WNG 11824 COMMUNIC Releasing  T187 command timeout

i think that this problem occurs because the SESSION_TIMEOUT is 60, and the loginTimeout is Unavailable at javax.sql.DataSource then the DBCP of tomcat dont know when need to revalidate the session.

thanks for any help.

Clóvis

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 02, 2008 at 08:02 PM

    Hi Clovis,

    afaik the javax.sql.DataSource.loginTimeout is not about a idle session timeout at the dbserver side, but about how long a login procedure is allowed to take (at least that's what the docs say ... [http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html#setLoginTimeout(int)]

    What you're facing are session timeouts that occur due to long inactive sessions on the database.

    Check the documentation on [Timeout|http://maxdb.sap.com/doc/7_6/5f/04a521376fa44a910797138d4ed497/content.htm].

    Perhabs it's enought just to increase the default timeout for the user you connect with.

    If this does not help you may check if you can provide connection properties for the jdbc connection and set an appropriate timeout there.

    KR Lars

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Lars Breddemann

      hi Lars,

      what i'm trying to solve is the problem explained at , dont using pool of connections works right for me, but when have many parallel requests, the JDBC driver locks the DriverSapDB object, and freeze the system, then because of that problem i now must create a pool of connections, and i wish to avoid session timeout, another thing about this blocked behavior is that only occurs in a Multi-Core CPU, having that running in a Single-Core the BLOCKED problem dont occurs.

      KR

      Clóvis