Hello all,

As some of you know, I've been working on JDBC-based appenders in the sandbox. I wanted to create a connection pool for environments where no such pool existed so that the JDBC appender would not have to create a new connection for every log message.

If you've never thought about JDBC connection pooling, the typical way to implement this is to create an implementation of java.sql.Connection that delegates (almost) all of the calls to another Connection object. When the client requests a Connection object, it gets one of these delegates from the pool. It uses it just like any other Connection object and never needs to know about the pooling. When the client calls close() on the connection, it is not really closed, but returned to the pool.

That is all well and good until you try to create an implementation java.sql.Connection that will work for Java 1.2 and up. The Connection interface has new methods on it for 1.3 and 1.4. No big deal, when you compile against 1.2 it won't care because the original interface will be satisfied....except that in 1.4 there are new classes (e.g. java.sql.SavePoint) referenced by the new methods. If you try to compile with 1.2, it will say, java.sql.SavePoint? never heard of it...

Does anybody have a solution to this? I'm not there is a good one...even if we do a conditional compilation somehow we would need to distribute a version of log4j for each Java version. (Because if you try to run a 1.4 compiled Connection implementation on a 1.2 JRE, there will be no SavePoint class and the class won't load. If you try to load a 1.2 compiled Connection implementation on a 1.4 JRE it will say you don't really implement the Connection I have...)

So, unless someone has a brilliant idea I guess I will abandon this idea for now...

Ray


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to