XAPool Project
Project Mail Lists
FAQs

Software
Downloads
License
Documentation
Examples
Success Stories

About Enhydra.org

Introduction


Welcome to the XAPool project !

XAPool is an open source XA Pool !

It allows to pool objects, JDBC connections (see the example) and XA connections (see the example and here).

It comes from Enhydra application server. Now the project is hosted by the OW2 consortium and managed by Experlog.


Request Cache (for results)


Request Cache (for results)

Description:
The request cache works independently of XAPool. To use it, you need to create a file with requests (SQL or not) which have to be cached. It is possible to specify a time-to-live parameter (millseconds) to force a life time of the results in the cache. By default, the time to live is 24 hours.

The syntax of this file must be the following:

  [#][ttl=[a_time_to_live] 
Elements between [ ] are optionals.
The # element allows to add a comment on the line, then, the result of this request will not be cached.

Example:
  ttl=123456789 select [*] from test

Regular expression:
A request could be a simple request, or a pattern of requests, to unify a lot of requests in the same result, allowing to match a lot of built requests on the same pattern. These patterns works with Regular Expression (RegEx) defined bo java (java.util.regex).

Example:
application request :
  Select * from employee
New syntax with regex :
  Select [*] from employee
This request contains .* which allows to matchs requests which have a beginning and and end, identical to the pattern (to the left and the right of the patternt). .* replace characters.

=> We obtain a generic request.

Constraints:
You need to re-evaluate some characters:
- you must add a \ character before the following characters: { } +
  ex: { will be \{
  ex: + will be \+
- if you use * character, you need to add [ and ] around this character
  ex: * will be [*]
Be carreful: You need to remove any blank line into the cache request file

To reset the cache:
To restart the requests cache, you need to call the reset() method:
  import org.enhydra.jdbc.util.RequestCache;
  RequestCache uc = RequestCache.getInstance();
  uc.reset();


XAPool 1.6.beta released


New XAPool 1.6.beta release

A new release of XAPool is available for download with several bug fixes for this beta version.
You can find in this release:
bug fixes:
- 300747 Null pointer in StandardPooledConnection due to missing log init
- 300774 NullPointerException in StandardXAPoolDataSource.toString()
- 301151 getGeneratedKeys not supported
- 303275 Problem with connection testing if test level is 3 or higher
- 303571 null pointer in multi thread.
- 303865 enum is a reserved word in JDK 1.5 and higher
- 304103 Problem with using Sybase JDBC driver in XAPool
- 304380 NullPointerException in GenericPool due to thread safety
- 304381 NullPointerException in PreparedStatementCache cleanupObject method

patchs:
- 303672 Fix for #303571
- 303673 Fix for #303462
- 304251 StandardXAConnectionHandle.close() too early release of Connection
- 304285 Fix for #304265: usage of StandardXA(Pool)DataSource with JNDI
- 305508 LRUCache has to check the old object before overwrite one

A cache of sql request is now available for this version, soon a complete documentation about it...


XAPool 1.5.0 released


XAPool 1.5.0 released !

This version fixes a lot of bugs, but validates some submissions by contributors too. thanks again to all people who works on this new version.
You can find in this release:
- #303280: XAPool does not cooperate with transaction manager when testing connections: this bug is fixed
- #303239: IllegalMonitorStateException in PoolKeeper: this bug is fixed
- #303191 (and #303192): unable to excute new connection after expiration: this bug is fixed
- #303302 StandardXADataSource.toString() fails with NullPointerException: this bug is fixed
- #300994: NullPointerException occurred when multi-thread access: this bug is fixed
- added jdbc 1.4 methods for Statement, PreparedStatement and CallableStatement objects
- added methods and fixed bugs about Statement and PreparedStatement objects which were not included into transactions
- added the last version of JOTM (2.0.8), new version of Carol, commons-logging, jotm_jrmp_stubs. And added connector-1_5.jar and howl.jar


XAPool 1.4.1 released


XAPool 1.4.1 released !

This version fixes a lot of bug, and validates some submissions by contributors. thanks to all people who works on this new version.
You can find in this release:
- bug fix for poolkeeper in while loop
- important submission from Tuomas Kantonen about synchronisation problem into the pool
- Hanging tomcat problem, poolkeeper object was not properly created
- added methods in CoreStatement for jdk 1.4
- bug found by Miro about TM which was not yet initialized (worked into 1.3.2), this bug has been fixed


XAPool 1.4 released


XAPool 1.4 released !

This version fixes a lot of bug, and validates some submissions by contributors. thanks to all people who works on this new version.
You can find in this release:
- Added commented out properties for connecting to Sybase (tlaurenzo)

- Fixed test suite in the following ways: (tlaurenzo)
- Removed JOTM registration with RMI
- Added "test" target to build file
- Changed all System.exit calls to "throw e" so that junit runs to completion
- Added the ability to override the datasource implementation being used by setting a spy.properties property
- Added log methods that take a Throwable parameter along with the message. These arguments are just passed down to commons logging (tlaurenzo)
- Bugs item #300773: deleted unsupported operation, and replaced by real method
- fixed a bug in checklevel object management, and added a test to loop on checkOut method (contrib), and added a toString call when a waiting for an object occurs
- Bugs item #300772: added controls to stop method and run method (synchronized) in poolkeeper thread
- Bugs item #300739: added setDataSource call to the constructor method in StandardXAPoolDataSource object
- Bugs item #300745: added Logger information to prevent nullpointerexception during object initialization in StandardDataSource
- added test when connection is closed in StandardXAConnectionHandle object


NEW! XAPool moves to LGPL, and 1.3.3 version is released


XAPool moves from EPL to LGPL this day. Many Enhydra projects move their license, you can find here the news, Package names will not change, we keep org.enhydra.jdbc architecture.

Link: http://www.gnu.org/copyleft/lesser.html


XAPool 1.3.2 released


XAPool 1.3.2 released !

You can find in this release:
- remove printStackTrace call in GenericPool class
- remove .error(...) calls, and replaced them by .debug(...)
- save autocommit status for CallableStatement object now
- restored autocommit after transaction (maybe a regression)
- restored autocommit for createStatement (never done)
- propagated the log object inside StandardConnectionPoolDataSource
- removed e.printStackTrace, and only use error level, with +e inside the message.
- added toString() method on several objects, to dump internal states of XAPool's objects
- added log.debug message into close() method (StandardXAConnectionHandle)
- change the status of isReallyUsed in the close() method (StandardXAConnectionHandle)
- set up the autocommit flag in the close() method when autocommit is false, and tx=null, just after the rollback call to the connection (StandardXAConnectionHandle)
- added a comment into CoreConnection object (setAutoCommit)
- removed unused code in StandardXAPreparedStatement and StandardXAStatement, preInvoke methods are no longer used.
- added toString methods on many objects to print out internal objects


09/01/03: How to set up JOnAS to work with XAPool 1.3.1


Please download JOnAS 3.2.2 sources, and XAPool 1.3.1 sources.

Unpack the 2 gzip files and replace the directory externals/jdbc/src/org.... by XAPool sources.

You have to edit your .properties file to setup the datasource:

######
#  Customizing JDBC DataSource configuration
#

#  Name of the class implementing the XADataSource
datasource.factory       \
       org.objectweb.jonas.dbm.JonasStandardXADataSource

#  JNDI name use to bind the XADataSource
datasource.xadataname   idb1_xa

#  Minimum number of physical connection used 
#  by the XADataSource
datasource.mincon       5

#  Maximum number of physical connection used 
#  by the XADataSource
datasource.maxcon       10

#  Minimum number of XAConnection used by the pool
jdbc.minconpool 10

#  Maximum number of XAConnection used by the pool
jdbc.maxconpool 20

#  Time between two clean-up of old unused connection
#  (value is in millisecond)
jdbc.sleeptimepool      300000

#  Force the gc to be launched when cleaning up
jdbc.gcpool             false

#  In case of no connection in the pool,
#  deadlockpool is the global time to re-try 
#  before throwing an exception
#  (value is in millisecond)
jdbc.deadlockpool       300000

#  In case of no connection in the pool,
#  loopwaitpool is the unit time to re-try
#  (value is in millisecond)
jdbc.loopwaitpool       10000
Edit the src/org/objectweb/jonas/dbm/DataBaseServiceImpl.java file, and remove the following line:
connect.setLogWriter( \
     Log.getLogWriter("org.objectweb.jonas.dbm"));
Edit the src/org/objectweb/jonas/dbm/JonasXAPoolDataSource.java file and change the following line:
log("JonasXAPoolDataSource:getReference \
            return a reference of the object");
with:
log.debug("JonasXAPoolDataSource:getReference \
            return a reference of the object");
If you want the trace, please add the line:
logger.org.enhydra.jdbc.xapool.level DEBUG
You need now to compile JOnAS, with the build.xml tool.
That's all...

XAPool Description

It exports:

- a DataSource (with a pool) which is a factory of PooledConnection,
- a XADataSource (with a pool) which is a factory of XAConnection (connections that can be used in distributed transactions).
XAPool has been successfully tested with MySQL, PostgreSQL, Oracle, SAPdb, MS SQL and InstantDB databases. We need contributions for other databases (about Informix and Sybase, we have the code, but not tested for the moment).

The classic pool offers common and useful operations:

- lifetime of objects
- a common log writer
- a minimum size
- a maximum size
- the possibility to setup a way to wait for objects when all objects are used
- an object check level to verify object before returning to user
- a garbage collection option
- a common PoolHelper object, to create, verify and destroy object
- objects are linked to a generation of objects when they are created


  XAPool News  
 


  12-19-2006: XAPool 1.6.beta released
  03-05-2005: XAPool 1.5.0 released
  11-02-2005: XAPool 1.4.1 released
  20-09-2004: XAPool 1.4 released
  11-24-2003: XAPool moves to LGPL (now 1.3.3)
  10-27-2003: XAPool 1.3.2 is now released here
  10-07-2003: We start to write a real FAQs (see the FAQs)
  08-29-2003: XAPool works now with JOnAS 3.2.2. The integration AGAIN !!! (see the following instruction)
  08-2003: Current stable version : 1.3.1


 
  Direct Access  
 


  XAPool project (Forge)

  Browse CVS repository

  Connecting to CVS

  Bugs / Patches / Support + feature requests

  Development news

  Editors  
 


  Pierre-Yves Gibello (Webmaster)


 
 
Sponsorship by
 
Sponsor