Daryl Stultz wrote:
"Jakarta Commons Users List" <[EMAIL PROTECTED]> writes:ok, not so tricky it seems, I just pointed to BasicDataSource because that is the one Tomcat uses. It is a sort of reference implementation.
Hi Daryl,Thanks for the references.
Constructing your own datasource can be a bit tricky, take a look at BasicDataSource as example
Really? I based mine on the examples and it seems to work just fine (with the exception of the class loading in the case of SQLServer). How do I use BasicDataSource?
But building your own is also nice
All the properties are given to java.sql.DriverManager.getConnection but yes they are probably ignored.A few pointers about your current code:You mean the others I set are ignored?
The properties you give to the DriverManagerConnectionFactory are the properties for your database driver.
In your case only "user" & "password".
It is not a driver factory but a connection factory using the java.sql.DriverManager and the java.sql.DriverManager requires a Class.forName().The driver itself should be loaded by a Class.forName(driver); as you would do without a pool.You mean I did it right? Shouldn't the driver factory do that for me?
The feature will probably remain in future releases but the implementation may be refactored if needed.Mapping of your old configuration:
* max connections - the maximum number of connections allowed out
=> connectionPool maxActive
* min connections - the number of connections to open upon start up
=> minIdle (not only at startup but always) (needs timeBetweenEvictionRunsMillis configuration)
* max checkout - the number of seconds a connection is allowed out of the pool
=> AbandonedConfig removeAbandonedTimeout
* connection reset time - a possibly DbConnectionBroker-specific recycle time (defaults to one day)
=> connectionPool minEvictableIdleTimeMillis (needs timeBetweenEvictionRunsMillis configuration)
I've got the 1.1 RC and AbandondedConfig is deprecated (what is the alternative?).
But it is safe to use.
Set removeAbandonedTimeout only if you have a connection leak in your application/dependant libs.Can you give me some reasonable values for the above (other than min and max connections since this is application dependant...)?
It should be higher then the longest time you use a connection.
minEvictableIdleTimeMillis is for network/database environment where connections are being closed by a firewall/database when they are idle for too long.
It is really dependent on the environment.
I see that I can set a logWriter but how do I configure it? It doesn'tLogging is a weak point, currently nothing is logged to the logWriter.
seem to be logging anything.
Dirk
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
