GenericPool: use of the pool, just to show it is a classical pool
Pool Datasource: a sample to use connection from a datasource
XA Pool Datasource: to get connection which can be used in distributed transactions (this example comes from JOTM)
MultipleConnection: demonstrate the use of multiple connections in the same transaction
MultipleTransaction: one connection and multiple transaction
FalseRollback: here no transaction, but a rollback on the connection close()
SaveAutoCommit: save the state of the autocommit flag before the beginnig of the transaction and restore it after the commit or the rollback of the transaction
SimpleStatement: test the Statement implementation
ds : datasource utx : UserTransaction c : Connection ... : means in most of the case, an executeUpdate on a PreparedStatement object
utx.begin(); c = ds.getConnection(); ... c.close(); c = ds.getConnection(); ... c.close(); utx.commit() or utx.rollback();
c = ds.getConnection(); utx.begin(); ... utx.commit(); utx.begin(); ... utx.rollback(); utx.close();
c = ds.getConnection(); c.setAutocommit(true); ... c.close(); c = ds.getConnection(); c.setAutoCommit(false); ... c.close();
autocommit2
and autocommit are equals.
c = ds.getConnection(); c.setAutoCommit(autocommit); utx.begin(); ... utx.commit(); autocommit2 = c.getAutoCommit(); c.close();