james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Cheng <jmch...@alum.mit.edu>
Subject Re: keeping a JDBC connection active
Date Wed, 14 Apr 2004 18:24:52 GMT

> I generally don't critique design patterns (let he who is without bad 
> design patterns cast the first stone), but permanently holding a 
> single database connection open is a Bad Idea(tm).  Some downsides:
> - your code is inherently single-threaded.
> - if you change to make it 1 thread = 1 db connection, you have a lot 
> of unnecessarily open db connections.
> - if you restart your db server, you get a failure in your app.
> - if you have a network failure, you get a failure in your app.

I'll also add what Serge implied, that sharing a single connection among 
multiple threads screws up transaction semantics and could easily lead 
to data corruption.

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message