Avoid properties conflict when configuring TomEE DataSource


TomEE now supports to switch the connection pooling implementation (commons-dbcp, tomcat-jdbc, bonecp…). However it tries to convert dbcp properties to the other implementation if these properties are found (mainly for compatibility reasons).

In some cases it can be hard.

Here some small tips to make it easier :).

First you can always validate your configuration connecting through JMX to TomEE and checking your datasource MBean.

Then to be sure to not use TomEE default values (which are for dbcp) and potentially get conflict (typically with tomcat-jdbc) simply add the property:

IgnoreDefaultValues = true

This property simply means you’ll specify all the configuration for your datasource + its pool and TomEE will not try to get any default values. This way you avoid conflicts and you don’t use the implicit convertion anymore :).

Note: this property works for any resource too (connection factory, …).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s