15

I read in c3p0´s manual link 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 AS 7.1.1 server. 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. Thanks in advance.

aloplop85
  • 892
  • 3
  • 16
  • 40
  • 1
    Just a note, the manual that you linked is referencing jboss 4.2.x or 5.x. The only reason to use c3p0 IMO would be if you want to make your app completely container agnostic or something like that. – feniix Jul 01 '13 at 15:08
  • I think there should be a way to start c3p0 MBeans inside JBOSS, but I don´t know where to place the jar and the xml (maybe under modules folder). – aloplop85 Jul 02 '13 at 08:26

0 Answers0