Deprecating C3P0 and our custom RDBMS DataConnector Syntax

Rod Widdowson rdw at steadingsoftware.com
Tue Aug 1 08:38:00 EDT 2017


I took an AI out of the last meeting to dive into this a bit further.  

Below is what I now know.  We can take this to Friday's meeting or discuss here.  Or both.

=
Bottom line is that after some spelunking I could now do with some input from those more widely versed in database deployment than
I.

It turns out that, as we suspected, the <ApplicationManagedConnection> is just a syntactic shim in front of c3p0.  Given that I'd
agree with Scott that the sensible thing to do is to deprecated this syntax in 3.4 and pull it in 4.0.  

This then raises the question of what we replace it with.

"Nothing" is a not-unappealing option.  Strictly speaking we would be replacing it by <BeanManagedConnection>.   The obvious
advantage is less code, the disadvantage being more complexity for the deployer.  On the other hand it feels to me that the need to
deploy against a RDBMS argues a reasonably complex deployment and so it is not unreasonable to expect the deployer to be able to
create DataSource from native Spring, particularly if we provided some documentation.

If we did provide some Custom Syntax then we need to answer a few more questions:

- What do we call it?  <DbcpManagedConnection> is an obvious choice.

- Given the obvious (is it?) choice of dbcp, which version?  The only reference to commons-dbcp that I can find is in OpenSAML tests
and that is version 1.4 (Java 6 compatible).   The Apache page [1] mentions a 2.2, but most 2.2 links that I poked at 404'd.  So
maybe 2.1.1 is better?  Or do we consider commons-pool2 as being in a dangerous state? ISTR that during the early V3 discussions
there was disquiet about some of the commons libraries.

- Given a choice of version, what setters do we want to expose via a custom syntax.    The dbcp BasicDataSource has around 40
setters.

 For the record the ApplicationManagedConnection exposes the following from C3P0.

    jdbcDriver 		(dbcp - BasicDataSource#setDriver(Driver))
    jdbcURL 		(dcpp  - BasicDataSource#setUrl(String))
    jdbcUserName 	(dcpp  - BasicDataSource#setUsername (String))
    jdbcPassword 	(dcpp  - BasicDataSource#setPassword (String))
    poolAcquireIncrement 
    poolAcquireRetryAttempts 
    poolAcquireRetryDelay 
    poolBreakAfterAcquireFailure 
    poolMinSize 
    poolMaxSize
    poolMaxIdleTime 
    poolIdleTestPeriod 

I suppose a compromise to help the neophyte would be a <SimpleManagedConnection> which uses dbcp, and takes the first four
qualifiers only.

Rod

[1] https://commons.apache.org/proper/commons-dbcp/



More information about the dev mailing list