-Vincent
On Sep 24, 2012, at 5:26 PM, Vincent Massol <vincent(a)massol.net> wrote:
Hi devs,
I was trying to make XEM work with HSQLDB and... I have succeeded :)
The only problem I have is that DBCP doesn't seem to work with Hibernate. For some
weird reasons when we do a SET SCHEMA it makes calls to fail afterwards. In any case if I
configure Hibernate to not use DBCP all work just fine.
I've googled around and found that there are lots of people complaining about DBCP.
I've googled for what connection pooling library to use and I've found that most
people are recommending BoneCP (
http://jolbox.com/).
See:
*
http://stackoverflow.com/questions/5640146/java-jdbc-connection-pool-librar…
*
http://www.jorambarrez.be/blog/2012/04/30/dbcp_vs_c3p0_bonecp/
*
http://stackoverflow.com/questions/8057110/java-database-connection-pool-bo…
The other thing is that we currently have some 300 line of code that we shouldn't
have at all and that we need in XWiki just for handling DBCP (see
com.xpn.xwiki.store.DBCPConnectionProvider).
The pro of BoneCP is that it seems to be the fastest, see
http://jolbox.com/benchmarks.html
So here's what I'd like to propose:
* We move DBCPConnectionProvider to a legacy module
* We bundle the bonecp jar by default
* We configure our hibernate.cfg.xml by default to use boneCP:
<property name="bonecp.idleMaxAge">240</property>
<property name="bonecp.idleConnectionTestPeriod">60</property>
<property name="bonecp.partitionCount">3</property>
<property name="bonecp.acquireIncrement">10</property>
<property
name="bonecp.maxConnectionsPerPartition">60</property>
<property
name="bonecp.minConnectionsPerPartition">20</property>
<property name="bonecp.statementsCacheSize">50</property>
<property name="bonecp.releaseHelperThreads">3</property>
<property
name="connection.provider_class">com.jolbox.bonecp.provider.BoneCPConnectionProvider</property>
What this means:
* Existing users of XWiki will not have to change anything, it'll still work
* New users will use bonecp without knowing
* Existing users can migrate to bonecp just by changing one line in their
hibernate.cfg.xml file
I'd love to do this for 4.3 but we're already quite advanced in the 4.x cycle.
That said it's just a one line change in hibernate.cfg.xml in case of problem to go
back to DBCP so we could do this for 4.3 which leaves us 4.3, 4.4 and 4.5 to test this
out. And if later on we find an issue we'll always be able to release a 4.5.1 that has
this one line change to go back to DBCP.
WDYT?
Here's my +1 for this action plan.
Thanks
-Vincent