Armin Waibel wrote:
which version of OJB do you use?
We still use db-ojb-1.0.rc6 but we are going to use the current realease.
Normally ConnectionFactoryPooledImpl tries 100 times to lookup a valid connection from the DB, so you should get the warning several times before the pool break.
Could you post the whole stack trace?
Here it is:
-----------------------------begin
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Query was select count(*) from datenklasse, Message was E/A-Exception: Socket closed
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Query was select count(*) from datenklasse, Message was E/A-Exception: Socket closed
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Query was select count(*) from datenklasse, Message was E/A-Exception: Socket closed
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: PersistenceBrokerException during the execution of the query: Used ConnectionManager instance could not obtain a connection
Used ConnectionManager instance could not obtain a connection
org.apache.ojb.broker.PersistenceBrokerException: Used ConnectionManager instance could not obtain a connection
at org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(Unknown Source)
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.getRsIteratorFromQuery(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown Source)
at de.mhr.wis.DBAdapter.ojbAdapter.Utils.getWea(Utils.java:627)
at de.mhr.wis.DBAdapter.ojbAdapter.management.OjbLogbuchAdapter.importStatusdaten(OjbLogbuchAdapter.java:392)
at de.mhr.wis.businessLayer.logic.management.LogBook.importStatusdaten(LogBook.java:879)
at de.mhr.wis.businessLayer.facades.rawdata.RawDataFacade.importStatusdaten(RawDataFacade.java:50)
at de.mhr.wis.communicationlayer.communicationmanager.importers.MitaImporter.importStatus(MitaImporter.java:723)
at de.mhr.wis.communicationlayer.communicationmanager.importers.MitaImporter.importSingleRawFile(MitaImporter.java:358)
at de.mhr.wis.communicationlayer.communicationmanager.importers.MitaImporter.importRawFile(MitaImporter.java:249)
at de.mhr.wis.communicationlayer.communicationmanager.RawFileManager.run(RawFileManager.java:221)
Caused by: org.apache.ojb.broker.accesslayer.LookupException: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED]
jcd-alias=default
default-connection=true
dbms=Oracle9i
jdbc-level=2.0
driver=oracle.jdbc.driver.OracleDriver
protocol=jdbc
sub-protocol=oracle
db-alias=thin:@(description=(address=(host=xxx.xx.x.xxx)(protocol=tcp)(port=1521))(connect_data=(sid=xxx)(server=dedicated)))
user=xx
password=*****
eager-release=false
ConnectionPoolDescriptor={whenExhaustedAction=1, validationQuery=select count(*) from datenklasse, maxIdle=10, maxActive=41, maxWait=20000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=true, minEvictableIdleTimeMillis=-1, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=true}
batchMode=false
useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
ignoreAutoCommitExceptions=false
[EMAIL PROTECTED]
sequenceManagerClass=class org.apache.ojb.broker.util.sequence.SequenceManagerOracleSequenceImpl
Properties={autoNaming=true, globalSequenceId=false, globalSequenceStart=10000, grabSize=20}
]
]
at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.getConnectionFromPool(Unknown Source)
at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConnection(Unknown Source)
at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Unknown Source)
... 18 more
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:801)
... 21 more
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: PersistenceBrokerException during the execution of the query: Used ConnectionManager instance could not obtain a connection
Used ConnectionManager instance could not obtain a connection
org.apache.ojb.broker.PersistenceBrokerException: Used ConnectionManager instance could not obtain a connection
at org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(Unknown Source)
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.getRsIteratorFromQuery(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown Source)
at de.mhr.wis.DBAdapter.ojbAdapter.Utils.getWea(Utils.java:627)
at de.mhr.wis.DBAdapter.ojbAdapter.management.OjbLogbuchAdapter.importStatusdaten(OjbLogbuchAdapter.java:392)
at de.mhr.wis.businessLayer.logic.management.LogBook.importStatusdaten(LogBook.java:879)
at de.mhr.wis.businessLayer.facades.rawdata.RawDataFacade.importStatusdaten(RawDataFacade.java:50)
at de.mhr.wis.communicationlayer.communicationmanager.importers.MitaImporter.importStatus(MitaImporter.java:723)
at de.mhr.wis.communicationlayer.communicationmanager.importers.MitaImporter.importSingleRawFile(MitaImporter.java:358)
at de.mhr.wis.communicationlayer.communicationmanager.importers.MitaImporter.importRawFile(MitaImporter.java:249)
at de.mhr.wis.communicationlayer.communicationmanager.RawFileManager.run(RawFileManager.java:221)
Caused by: org.apache.ojb.broker.accesslayer.LookupException: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED]
---------------------------end
and so on.
Is the information enough or do you need any more?
Thanks for help!
regards
Thomas
Hello there,
Our application should work twenty-for seven. Suddenly an exception occurs. This exception isn't caught in the application, instead I see it on the console. (At the moment we start the application from the console).
For example I see:
... WARN: Validation query for connection failed. ...
Nested Exception
unexpected end of input stream
...
After that the application doesn't work anymore. It seems like I can no longer establish a connection to the database. The only way to get the application running again is the comlete new start.
We use the following classes:
-----------------------begin
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl
ConnectionManagerClass=org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
-----------------------end
The repository.xml looks like this for example:
--------------------------begin
<class-descriptor class="de.softenery.wis.mydata" table="mydata" > <field-descriptor id="1" name="id" column="mydata_id" jdbc-type="INTEGER" primarykey="true" autoincrement="true" access="readonly" /> <field-descriptor id="2" name="weaId" column="w_id" jdbc-type="INTEGER" /> <field-descriptor id="22" name="modifikation" column="modifikation" jdbc-type="TIMESTAMP" conversion="de.mhr.wis.DBAdapter.ojbAdapter.Calendar2Timestamp" /> <field-descriptor id="23" name="timestamp" column="zeitstempel" jdbc-type="TIMESTAMP" conversion="de.mhr.wis.DBAdapter.ojbAdapter.Calendar2Timestamp" /> </class-descriptor>
---------------end
The repository_database.xml looks like this:
------------------begin
<jdbc-connection-descriptor jcd-alias="sow" default-connection="true" platform="MySQL" jdbc-level="2.0" driver="org.gjt.mm.mysql.Driver" protocol="jdbc" subprotocol="mysql" dbalias="//192.99.90.199:3306/sow" username="gogo" password="45jdkekdl" eager-release="false" batch-mode="false" useAutoCommit="1" ignoreAutoCommitExceptions="false" >
<connection-pool whenExhaustedAction="2" maxActive="21" validationQuery="select count(*) from datenklasse" />
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl">
</sequence-manager> </jdbc-connection-descriptor>
---------------end
And the code looks like this:
----------------------begin
try { broker = PersistenceBrokerFactory.defaultPersistenceBroker(); broker.beginTransaction();
[...] broker.getObjectByQuery(query); [...]
broker.store(data); } broker.commitTransaction();
} catch (TransactionInProgressException e) { logger.error(e); } catch (TransactionAbortedException e) { logger.error(e); } catch (TransactionNotInProgressException e) { logger.error(e); } catch (PBFactoryException e) { logger.error(e); } catch (PersistenceBrokerException e) { logger.error(e); } catch (Exception e) { logger.error(e); } finally { if (broker != null) { broker.clearCache(); broker.close(); } }
----------------end
Can anyone give me any help on this?
regards
Thomas
-- Mit freundlichen Grüßen
Thomas Franke
Geschäftsführer softEnergy GmbH ---------------------------- The energy for a better world ---------------------------- softEnergy GmbH Platz der Freundschaft 1 18059 Rostock ---------------------------- fon: +49 381 40 587 535 fax: +49 381 40 587 555 mobil: +49 1715222015
http://www.softenergy.de mail: [EMAIL PROTECTED] ----------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]