0 Replies Latest reply on Jun 28, 2013 4:59 AM by allopez

    Use c3p0 with JBOSS AS 7.1.1

    allopez

      Hello everyone,

       

      I read in c3p0´s manual: http://www.mchange.com/projects/c3p0/#jboss-specific  that it is possible to use c3p0 library inside JBOSS as an MBean.

      Once configured correctly, I would like to reference the new C3P0PooledDataSource in my Java WAR through its JNDI name. As I am using Spring

      it would be something similar to:

       

      [src/webapp/WEB-INF/applicationContext.xml]

       

      <jee:jndi-lookup id="dataSource" jndi-name="java:PooledDS" />

       

      However, I don´t know how to configure this library properly. I tried to place c3p0-0.9.2.1.jar and c3p0-service.xml in the folders commented in the manual

      but I had no luck .       

       

      I am currently developing a project which uses a MySql database, so I have instaled the mysql connector inside the JBOSS.

      I have to say that if I integrate c3p0 and MySql connector in my project I can deploy it correctly. So...:

       

      • Is it possible to use c3p0 connection pool inside JBOSS AS 7.1.1 as described in its manual? How should I configure it?

       

      I started to "play" with c3p0 because of its large number of configuration properties, but I don´t know if c3p0 is better than embedded JBOSS pooling capabilities.

       

      • Does c3p0 library deserve to be used instead of JBOSS embedded connection pool (i.e. configuring a datasource with the admin console/web) ?

       

      I appreciate any comments to these matters.