[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-development
Subject:    JDBC connection pool properties
From:       Dain Sundstrom <dain () iq80 ! com>
Date:       2007-07-19 20:05:59
Message-ID: 7E350ED9-95EC-4786-8F6D-660FF41F0A51 () iq80 ! com
[Download RAW message or body]

I just added documentation to the service-jar.xml file for the new  
DBCP based connection pools.  This documentation is mostly copied  
from the DBCP website, but I did rewire and expand some sections.  It  
is a lot of text and would appreciate any time you could spend  
reviewing it.  Also, I set the default pool values as follows:

Default JDBC Database
     InitialSize	0
     MaxActive	20
     MaxIdle	20
     MaxWait	-1

Default Unmanaged JDBC Database
     InitialSize	0
     MaxActive	10
     MaxIdle	10
     MaxWait	-1

Normally, the unmanaged datasource is not used, so I gave it a  
smaller size.  We could set maxActive to unlimited, and the pool will  
create more connections as needed.

Please, reply if you think they should be different, or if you think  
some of the documentation should be changed or isn't clear.

-dain


     # Driver class name

     JdbcDriver org.hsqldb.jdbcDriver

     # Url for creating connections

     JdbcUrl jdbc:hsqldb:file:hsqldb

     # Default user name

     UserName sa

     # Default password

     Password

     # The connection properties that will be sent to the JDBC
     # driver when establishing new connections
     #
     # Format of the string must be [propertyName=property;]*
     #
     # NOTE - The "user" and "password" properties will be passed
     # explicitly, so they do not need to be included here.

     ConnectionProperties

     # The default auto-commit state of new connections

     DefaultAutoCommit true

     # The default read-only state of new connections
     # If not set then the setReadOnly method will not be called.
     # (Some drivers don't support read only mode, ex: Informix)

     # DefaultReadOnly


     # The default TransactionIsolation state of new connections
     # If not set then the setTransactionIsolation method will not
     # be called. The allowed values for this property are:
     #     NONE
     #     READ_COMMITTED
     #     READ_UNCOMMITTED
     #     REPEATABLE_READ
     #     SERIALIZABLE
     #
     # Note: Most JDBC drivers do not support all isolation levels

     # DefaultTransactionIsolation


     # The initial number of connections that are created when the
     # pool is started

     InitialSize	0

     # The maximum number of active connections that can be
     # allocated from this pool at the same time, or a negative
     # number for no limit.

     MaxActive	20

     # The maximum number of connections that can remain idle in
     # the pool, without extra ones being released, or a negative
     # number for no limit.

     MaxIdle	20

     # The minimum number of connections that can remain idle in
     # the pool, without extra ones being created, or zero to
     # create none.

     MinIdle	0

     # The maximum number of milliseconds that the pool will wait
     # (when there are no available connections) for a connection
     # to be returned before throwing an exception, or -1 to wait
     # indefinitely.

     MaxWait	-1

     # The SQL query that will be used to validate connections from
     # this pool before returning them to the caller. If specified,
     # this query MUST be an SQL SELECT statement that returns at
     # least one row.

     # ValidationQuery

     # If true connections will be validated before being returned
     # from the pool. If the validation fails, the connection is
     # destroyed, and a new conection will be retrieved from the
     # pool (and validated).
     #
     # NOTE - for a true value to have any effect, the
     # ValidationQuery parameter must be set.

     TestOnBorrow	true

     # If true connections will be validated before being returned
     # to the pool.  If the validation fails, the connection is
     # destroyed instead of being returned to the pool.
     #
     # NOTE - for a true value to have any effect, the
     # ValidationQuery parameter must be set.

     TestOnReturn	false

     # If true connections will be validated by the idle connection
     # evictor (if any). If the validation fails, the connection is
     # destroyed and removed from the pool
     #
     # NOTE - for a true value to have any effect, the
     # timeBetweenEvictionRunsMillis property must be a positive
     # number and the ValidationQuery parameter must be set.

     TestWhileIdle	false

     # The number of milliseconds to sleep between runs of the idle
     # connection evictor thread. When set to a negative number, no
     # idle connection evictor thread will be run.

     TimeBetweenEvictionRunsMillis	-1

     # The number of connectionss to examine during each run of the
     # idle connection evictor thread (if any).

     NumTestsPerEvictionRun	3

     # The minimum amount of time a connection may sit idle in the
     # pool before it is eligable for eviction by the idle
     # connection evictor (if any).

     MinEvictableIdleTimeMillis	1800000

     # If true, a statement pool is created for each Connection and
     # PreparedStatements created by one of the following methods are
     # pooled:
     #    public PreparedStatement prepareStatement(String sql);
     #    public PreparedStatement prepareStatement(String sql,
     #            int resultSetType,
     #            int resultSetConcurrency)

     PoolPreparedStatements false

     # The maximum number of open statements that can be allocated
     # from the statement pool at the same time, or zero for no
     # limit.
     #
     # NOTE - Some drivers have limits on the number of open
     # statements, so make sure there are some resources left
     # for the other (non-prepared) statements.

     MaxOpenPreparedStatements 0

     # If true the raw physical connection to the database can be
     # accessed using the following construct:
     #     Connection conn = ds.getConnection();
     #     Connection rawConn = ((DelegatingConnection)  
conn).getInnermostDelegate();
     #     ...
     #     conn.close()
     #
     # Default is false, because misbehaving programs can do harmfull
     # things to the raw connection shuch as closing the raw
     # connection or continuing to use the raw connection after it
     # has been assigned to another logical connection.  Be carefull
     # and only use when you need direct access to driver specific
     # extentions.
     #
     # NOTE: Do NOT close the underlying connection, only the
     # original logical connection wrapper.

     AccessToUnderlyingConnectionAllowed	false

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic