Hello altogether!, a month ago I posted a question regarding problems with the database connection of my JSP- application; after some hours (don't know exactly, perhabs 12h) the connection is killed, probably by the database server (MySQL). Armin Waibel was so kind to help me with this proposals:
On Thu, 12 Feb 2004 14:25:48 +0100 Armin Waibel wrote: > Seems that the connections in the connection-pool (assume you don't use > DataSource) are get timed out. > > - Some DB allow to reconnect timed out connections, try to enable this. > - Or you can use the 'validationQuery' attribute to force OJB to do a > real check before a connection was returned from pool. > - Or don't use a connection pool by setting > ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl > (has performance impact). > - Or setup pool configuration to evict idle connections before they get > timed out. commons-pool attributes reflected as 'connection-pool' > attributes. See more > http://db.apache.org/ojb/repository.html#connection-pool > http://jakarta.apache.org/commons/pool/apidocs/org/apache/commons/pool/impl/GenericKeyedObjectPool.html > - Or use DataSource from your webServer (and hope your webserver does > handle timed out connections for you ;-)) > - Or write your own ConnectionFactory implementation ;-) I tried several of them, but had now luck :( Does anyone have any further idea? That would be great! I have set the ConnectionFactoryClass to "org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl" in my ojb.properties, and down under follows my repository_database.xml. Thank you quite much, Hinnerk <!-- this connection was used as the default one within OJB --> <jdbc-connection-descriptor jcd-alias="*****" default-connection="true" platform="MySQL" jdbc-level="2.0" driver="org.gjt.mm.mysql.Driver" protocol="jdbc" subprotocol="mysql" dbalias="****" username="*****" password="**" eager-release="false" batch-mode="false" useAutoCommit="1" ignoreAutoCommitExceptions="false" > <connection-pool maxActive="10" maxIdle="5" maxWait="6000" minEvictableIdleTimeMillis="6000" numTestsPerEvictionRun="5" timeBetweenEvictionRunsMillis="60000" whenExhaustedAction="2" validationQuery="select count(*) from users" /> <sequence-manager> className="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl"> <attribute attribute-name="grabSize" attribute-value="20"/> <attribute attribute-name="autoNaming" attribute-value="true"/> <attribute attribute-name="globalSequenceId" attribute-value="false"/> <attribute attribute-name="globalSequenceStart" attribute-value="10000"/> </sequence-manager> </jdbc-connection-descriptor> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
