You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Charles Anthony <ch...@hpdsoftware.com> on 2005/03/10 12:47:27 UTC

RE: Strange connection exception while querying.

The problem is that the connection pool is being "exhausted" - looking at
the exception, the pool is configured with a max 20. I suspect this is
because the broker is not being closed; you must close the broker when you
are finished with it.

Cheers, 

Charles.

> -----Original Message-----
> From: Ruud van de Laar [mailto:ruud.vandelaar@bergland-it.nl]
> Sent: 10 March 2005 11:52
> To: ojb-user@db.apache.org
> Subject: Strange connection exception while querying.
> 
> 
> Hello everyone!
> 
> I am using OJB for my webshop inside exoplatform (portal framework). 
> When I go to my orderlist, a select query is called upon the 
> ojb tables 
> "customer"and "order". Sometimes when I am viewing this list the 
> customername doesn't appear and I get the following exception:
> 
> /exception while getting customername: 
> org.apache.ojb.broker.PersistenceBrokerException: 
> org.apache.ojb.broker.PersistenceBrokerException: Used 
> ConnectionManager 
> instance could not obtain a connection
> [org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractIm
> pl] ERROR: 
> Connection for JdbcConnectionDiscriptor (db-url: 
> jdbc:mysql://localhost/shop, user: root) was not valid, 
> either *closed* 
> or *null*
> [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
> 
> /This happens sometimes when I go to the orderlist. And only the 
> customername isn't displayed. But when I press F5 for about 
> 20-25 times 
> (while testing for this error/bug) my whole OJB connection is 
> gone and I 
> get this error:
> 
> /Caused by: org.apache.ojb.broker.accesslayer.LookupException:
> Could not borrow connection from pool - 
> org.apache.ojb.broker.metadata.JdbcConnectionDescriptor:
> org.apache.ojb.broker.metadata.JdbcConnectionDescriptor@5266e0[
>   jcd-alias=default
>   default-connection=true
>   dbms=MySQL
>   jdbc-level=3.0
>   driver=com.mysql.jdbc.Driver
>   protocol=jdbc
>   sub-protocol=mysql
>   db-alias=//localhost/shop
>   user=root
>   password=*****
>   eager-release=false
>   ConnectionPoolDescriptor={whenExhaustedAction=0, 
> validationQuery=select 1, max
> Idle=-1, maxActive=21, maxWait=5000, removeAbandoned=false, 
> numTestsPerEvictionR
> un=10, testWhileIdle=false, minEvictableIdleTimeMillis=600000, 
> testOnReturn=fals
> e, logAbandoned=false, removeAbandonedTimeout=300, 
> timeBetweenEvictionRunsMillis
> =-1, testOnBorrow=false}
>   batchMode=false
>   useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
>   ignoreAutoCommitExceptions=false
>   
> sequenceDescriptor=org.apache.ojb.broker.metadata.SequenceDesc
> riptor@1a50791[
>      sequenceManagerClass=class 
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
>      Properties={autoNaming=true, globalSequenceId=false, 
> globalSequenceStart=10
> 000, grabSize=20}
> 
> 
> /Does anybody have an idea what could have gone wrong?
> 
> tia. Ruud.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


___________________________________________________________
HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Strange connection exception while querying.

Posted by Ruud van de Laar <ru...@bergland-it.nl>.
Thanks Charles for your quick reply.

That was indeed the problem.... I didn't close the broker. :)


Charles Anthony wrote:

>The problem is that the connection pool is being "exhausted" - looking at
>the exception, the pool is configured with a max 20. I suspect this is
>because the broker is not being closed; you must close the broker when you
>are finished with it.
>
>Cheers, 
>
>Charles.
>
>  
>
>>-----Original Message-----
>>From: Ruud van de Laar [mailto:ruud.vandelaar@bergland-it.nl]
>>Sent: 10 March 2005 11:52
>>To: ojb-user@db.apache.org
>>Subject: Strange connection exception while querying.
>>
>>
>>Hello everyone!
>>
>>I am using OJB for my webshop inside exoplatform (portal framework). 
>>When I go to my orderlist, a select query is called upon the 
>>ojb tables 
>>"customer"and "order". Sometimes when I am viewing this list the 
>>customername doesn't appear and I get the following exception:
>>
>>/exception while getting customername: 
>>org.apache.ojb.broker.PersistenceBrokerException: 
>>org.apache.ojb.broker.PersistenceBrokerException: Used 
>>ConnectionManager 
>>instance could not obtain a connection
>>[org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractIm
>>pl] ERROR: 
>>Connection for JdbcConnectionDiscriptor (db-url: 
>>jdbc:mysql://localhost/shop, user: root) was not valid, 
>>either *closed* 
>>or *null*
>>[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
>>
>>/This happens sometimes when I go to the orderlist. And only the 
>>customername isn't displayed. But when I press F5 for about 
>>20-25 times 
>>(while testing for this error/bug) my whole OJB connection is 
>>gone and I 
>>get this error:
>>
>>/Caused by: org.apache.ojb.broker.accesslayer.LookupException:
>>Could not borrow connection from pool - 
>>org.apache.ojb.broker.metadata.JdbcConnectionDescriptor:
>>org.apache.ojb.broker.metadata.JdbcConnectionDescriptor@5266e0[
>>  jcd-alias=default
>>  default-connection=true
>>  dbms=MySQL
>>  jdbc-level=3.0
>>  driver=com.mysql.jdbc.Driver
>>  protocol=jdbc
>>  sub-protocol=mysql
>>  db-alias=//localhost/shop
>>  user=root
>>  password=*****
>>  eager-release=false
>>  ConnectionPoolDescriptor={whenExhaustedAction=0, 
>>validationQuery=select 1, max
>>Idle=-1, maxActive=21, maxWait=5000, removeAbandoned=false, 
>>numTestsPerEvictionR
>>un=10, testWhileIdle=false, minEvictableIdleTimeMillis=600000, 
>>testOnReturn=fals
>>e, logAbandoned=false, removeAbandonedTimeout=300, 
>>timeBetweenEvictionRunsMillis
>>=-1, testOnBorrow=false}
>>  batchMode=false
>>  useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
>>  ignoreAutoCommitExceptions=false
>>  
>>sequenceDescriptor=org.apache.ojb.broker.metadata.SequenceDesc
>>riptor@1a50791[
>>     sequenceManagerClass=class 
>>org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
>>     Properties={autoNaming=true, globalSequenceId=false, 
>>globalSequenceStart=10
>>000, grabSize=20}
>>
>>
>>/Does anybody have an idea what could have gone wrong?
>>
>>tia. Ruud.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>    
>>
>
>
>___________________________________________________________
>HPD Software Ltd. - Helping Business Finance Business
>Email terms and conditions: www.hpdsoftware.com/disclaimer 
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org