S2DBCP offers database connection pooling using POJO. By integrating with JTA, transactions are maintained even after connections are opened and closed several times. Hence, it is no longer necessary to have several classes pass connections to maintain JDBC transactions.
Furthermore, it is possible to use S2Tx, to automatically manage transactions with Aspect.
It is necessary to configure XADataSource and ConnectionPool to use S2DBCP. XADataSource may be use if it is supported by the JDBC driver. If it is not supported, S2's XADataSourceImpl interface may be used to emulate XA.
org.seasar.extension.dbcp.impl.XADataSourceImpl
Property
Description
Example
driverClassName
JDBC Driver class name
"oracle.jdbc.driver.OracleDriver"
URL
Oracle database URL
"jdbc:oracle:thin:@xxx:1521:yyy"
user
User name to connect to database
"hoge"
password
Password of user to connect to database
"password"
org.seasar.extension.dbcp.impl.ConnectionPoolImpl
Property
Description
Example
XADataSource
XADataSource instance. When using S2Container, set to component name of XADataSource.
xaDataSource
transactionManager
TransactionManager instance. When using S2Container, set to component name of TransactionManager.
transactionManager
timeout
Time interval in seconds for unused connections which are returned to the pool to be closed and destroyed. Default value is 600 seconds (10 minutes).
600
maxPoolSize
Maximum number of concurrent connections. When number of connections exceeds this number, a new request are blocked until a connection is returned to the pool. Default value is 10 connections.
10
Connections are set as follows. Please modify it as needed to make it specific for your application.