On 27/01/12 18:25, John Fereira wrote:
On 24/01/12 15:16, John Fereira wrote:
...
If it's overnight, is this the MySQL timeout idle connections
issue? MySQL, by default, kills connections after (IIRC) 8 hours of
idleness.

Yes, the connection closed overnight (and yes the idle value is 8
hours, based on the wait_timeout or interactive_timeout mysql
variables).   I guess my question is "why is a connection being held
open for 8 hours?".

SDB doesn't itself do connection pooling. The idea is that it's done outside by the app, on the basis that the app knows best.

http://incubator.apache.org/jena/documentation/sdb/javaapi.html#connection_management

But in Joseki,Fuseki they just want a handle to a thing to query or update.

There's a conceptual gap in the responsibilities. Pooled connections fell down that gap. It ought to be an option for SDB.

No other system I know of times out connections and complains if they are used after forced system close.



Connection pooling is a good solution to this, the crude way is
?autoReconnect=true or adjust the server settings to some very,
very long period.


I thought I'd read something that setting ?autoReconnect=true didn't
seem to fix the problem.

The main argument against ?autoReconnect is that MySQL recommend against it and they keep talking about removing it.

        Andy

 It seems that adjusting the idle timeout to
a very long period would just result in running out of database
connections eventually.   Connection pooling *would* be a good
solution as long as the connection is returned to the pool once the
transaction is complete.

Adding connection pooling support to SDB would be good.  There's
nothing there except an assembler setting to set the number and a
comment in SDBConnection about where it might hook in ... but
that's as far as it goes

There is a "pool" comment in SDBConnection but it looks like the
place to add pooling would be in the SDBConnectionFactory (which also
has a pooling comment).  It currently obtains a java.sql.Connection
using JDBC.createConnection.  I think I can figure out where to
inject connection pooling but I'm not quite sure what its' doing when
sdb:jdbcUrl is not specified in the desc file.


Not sure of the status of c3po ... one preview release in 2010-05
but before that 2007-05.  Maybe Apache Commons DBCP is a better
bet.

I'm certainly not married to c3p0...it's just what I found to be a
bit more reliable a few years ago when I was implementing connection
pooling in one of my web applications.


Reply via email to