Hi Daniel,
Daniel Perry wrote:
I'm still getting these errors in my app.
Currently i'm using i've got ConnectionFactoryPooledImpl set in ojb.properties, and in the repository_database.xml i have the following in my jdbc-connection-descriptor:
<connection-pool minActive="5" maxActive="50" whenExhaustedAction="2" validationQuery="select count(*) from OJB_HL_SEQ" />
Is there a reason i would get these errors? Surely the connection pool should be validating the connection before handing it out, and then it should be fine?
I doubt that the ConnectionFactory implementation cause this error, because it's the first time I heard about such a problem and the validation query is working AFAIK (did you check this by logging the sql statements e.g. with p6spy?)
Is ConnectionFactoryDBCPImpl any better than the one i'm using?
Both ConnectionFactory implementations use commons-pool, but DBCP is a JDBC/Pool/Datasource api build on top of commons-pool. If this implementation will work you found a bug in ConnectionFactoryPooledImpl ;-)
I am considering switching to ConnectionFactoryNotPooledImpl, but it would mean a big performance hit!
Is the error always caused by the same class
>>>>at >>>>org.apache.taglibs.standard.tag.common.core.ForEachSupport.toForE >>> >>>achIterator
or always caused when materialized a proxied collection?
Does the error occur when OJB materialize a class with clob/blob or binary/object field?
Is there a way for me to clear the connection pool?
You can try ConnectionFactoryFactory.createConnectionFactory().releaseAllResources()
CFF is a singleton. This call clear the used pool and close all connections of the pool (connections in use will be ignored AFAIK)
Or extend ConnectionFactoryPooledImpl and add your own monitoring methods.
regards, Armin
As it's only when the system has been running for a while that i see these errors, i figure if i clear the pool every half hour, it should stop it!
Daniel.
-----Original Message----- From: Daniel Perry [mailto:[EMAIL PROTECTED] Sent: 11 October 2004 16:20 To: OJB Users List Subject: RE: SQLExcpetion
Ah i forgot to mention - mysql and tomcat are on the same machine :) which kinda counts out network problems.
I cant see any reason why i'd get these errors (at least on a 1 machine system). The connection pool should prevent them happening due to timeouts/etc. If it doesnt, then i'd expect to find that mysql had died, and the system to remain down until it had been started up again.
Daniel.
-----Original Message----- From: Edson Carlos Ericksson Richter [mailto:[EMAIL PROTECTED] Sent: 11 October 2004 16:07 To: OJB Users List Subject: Re: SQLExcpetion
If you try to copy large files between machines, you get Connection Reset (or connection reset by peer, in some OSes)??? If so, you get a trahsed network card or network hub... I had this problem some time ago, and I had to exchange a hub with some ports "burned", sending trash in my network...
Just my 2c,
Richter
Daniel Perry escreveu:
Hi all,
One of our systems has been running fine (live) for the last few
weeks until
yesterday when for about half an hour it started randomly
crashing. Since
then it has been fine! The (partial) exception trace is below.
From what i
can figure the problem is coming from dud mysql connections.
However, i
thought that OJB checked the connection before using it by using the validation query?
I'm using OJB 1.0.0, mysql-connector 3.0.10, and mysql 4.0.18.
Any ideas about what would cause this? Anyway i can prevent
it occuring
again?
Thanks, Daniel.
[org.apache.ojb.broker.accesslayer.StatementsForClassImpl] ERROR: No operations allowed after connection closed.
Connection was closed due to the following exception:
** BEGIN NESTED EXCEPTION **
java.sql.SQLException MESSAGE: Communication link failure: java.io.IOException,
underlying cause:
Unexpected end of input stream
** BEGIN NESTED EXCEPTION **
java.io.IOException MESSAGE: Unexpected end of input stream
STACKTRACE:
java.io.IOException: Unexpected end of input stream at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1455) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1826) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1098) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1192) at com.mysql.jdbc.Connection.execSQL(Connection.java:2051) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.j
ava:1496)
at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
Source) at
org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown
Source) at org.apache.ojb.broker.accesslayer.RsIterator.<init>(Unknown Source) at
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unknown
Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFro
mQuery(Unkn
own Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQ
uery(Unknow
n Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQu
ery(Unknown
Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQu
ery(Unknown
Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQ
uery(Unknow
n Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollect
ionByQuery(
Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollect
ionByQuery(
Unknown Source) at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.loadD
ata(Unknown
Source) at
org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl.loadData(Unknown
Source) at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.getDa
ta(Unknown
Source) at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.itera
tor(Unknown
Source) at org.apache.taglibs.standard.tag.common.core.ForEachSupport.toForE
achIterator
(ForEachSupport.java:329)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
