resthub / resthub-spring-stack

RESThub Spring stack
http://resthub.org/spring-stack.html
Other
121 stars 66 forks source link

Change datasource class? #155

Closed bclozel closed 11 years ago

bclozel commented 11 years ago

Should we switch from apache commonds DBCP to apache tomcat dbcp? We're currently using org.apache.commons.dbcp.BasicDataSource.

<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>dbcp</artifactId>
    <version>6.0.36</version>
</dependency>

See this article for reference.

sdeleuze commented 11 years ago

Should be great to have the advice of Romain and/or Jean Louis about that, could you check with them ? Also we should ensure that it works under Jetty.

sdeleuze commented 11 years ago

Interesting thread on stackoverflow : http://stackoverflow.com/questions/4711943/tomcat-dbcp-vs-commons-dbcp

bclozel commented 11 years ago

/summon @rmannibucau What do you think about that Romain?

rmannibucau commented 11 years ago

tomcat-dbcp == commons-dbcp (that's a shade) tomcat-jdbc == fork for higher availability apps

t-jdbc is a bit faster and has some nice features (thanks to interceptor model)

That's said you are in a spring stack so you should maybe consider bonecp which is as interesting as tomcat-jdbc

Side note: it supposes you don't use JTA features of dbcp otherwise you'd need to reimplement it but i guess that's fine in your context

bclozel commented 11 years ago

Great advice. So we should consider bonecp (nice performances, see benchmark) or tomcat-jdbc (very interesting features, you mentioned interceptors).

bclozel commented 11 years ago

I've got a little experiment that I will contribute with a PR. Problem is: using bonecp changes things, because it's using different concepts for pool management. So it implies database.properties changes for existing applications.