blob: 9b3c557d671af35bd57ad7242d1948e45778048d [file] [log] [blame]
This devtest tries to test whether the appserver
removes a connection from pool after using it for
"maxconnectionusage" times.
Scenario :
1) Pool with size 1
2) DataSource of type javax.sql.DataSource / javax.sql.XADataSource
3) Transaction Attribute of ejb as "NotSupported"
test1()
a) Local, NoTx
b) XA, NoTx
Set "maxconnectionusage" to 10. Test will acquire 11 connections.
If 1st and 11nth connection (physical connection) are different,
test passes.
NOTE: Changing tx-attribute or datasource type or sharing mode may yield
different results.
Scenario :
1) Pool with size 1
2) DataSource of type javax.sql.DataSource / javax.sql.XADataSource
3) DataSources as type "shareable" in ejb desciptor
3) Transaction Attribute of ejb as "Required"
test2() & test3()
a) Local, Tx, Shareable
b) XA, Tx, Shareable
NOTE : (b) will not work as physical connection (ds.getConnection(conn)) will be different
during each invocation.
test2() will add entries and return the physical connection's id
test3() will test whether the entries are persisted and return the
physical connection's id
Since the pool has only 1 connection, calling test2() & test3() 5 times each
will ensure that "maxconnectionusage=10" is met.
Further call to test2() will return a different connection.
If they are different, connection was dropped and created, test passes.