Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 62391 invoked from network); 12 Feb 2004 20:06:09 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Feb 2004 20:06:09 -0000 Received: (qmail 84554 invoked by uid 500); 12 Feb 2004 20:05:55 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 84523 invoked by uid 500); 12 Feb 2004 20:05:55 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 84505 invoked from network); 12 Feb 2004 20:05:55 -0000 Received: from unknown (HELO MAIL.osn.state.oh.us) (66.145.203.12) by daedalus.apache.org with SMTP; 12 Feb 2004 20:05:55 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: ManagedConnections not being released Date: Thu, 12 Feb 2004 15:06:00 -0500 Message-ID: <316E5B943771D311BAC500805FD7A078025F369F@MAIL.osn.state.oh.us> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ManagedConnections not being released Thread-Index: AcPxkqyuP5EXYKZ6R9uZUoszfs6jfQAD4F9g From: "Clute, Andrew" To: "OJB Developers List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Armin, After further investigation, I can confirm it is related to the use of Proxy's. Now, I have theory, and I want to see if this could be possible: With a normal method on an EJB and using CM-tx, when the EJB method is finished, the EJB container calls commit and PersistenceBrokerFactorSyncImpl is called, and that is the change that OJB has to wrap up it's work, and physically close the database connection. However, when using a proxy (even when both client and EJB are in the same VM), it's access to the data is through a new instance of a PersistenceBroker. That is causing a new connection to be opened up, but because it is not inside a method call to an EJB, there is no 'Commit' phase that happens, and so PBFSync is never called and allowed to close the database connection. Do think this is accurate? So, the solution to this is for me to create my own collection proxy that can call an EJB to get the data from OJB -- that will mean that the call for that will be inside an EJB transaction. I am assuming I also going to have to write a custom IndirectionHandler to handle the 1:1 proxy's (but that doesn't seem to be pluggable in the OJB.properities file) Thoughts -Andrew=20 -----Original Message----- From: Armin Waibel [mailto:arminw@apache.org]=20 Sent: Thursday, February 12, 2004 1:05 PM To: OJB Developers List Subject: Re: ManagedConnections not being released Hi, Clute, Andrew wrote: > I have the latest from head. I am using Jboss 3.2.3, with CM-tx for my > EJB's. I have my connection pool set to a maximum of 30 connections,=20 > but it fills up real quick. I am closing the PersistenceBroker, and I=20 > have debuged, and I do see the _conn.close() being called on the Jboss > WrappedConnection, but I look and all 30 connections are used. >=20 >=20 hmm, I assume you are using proxy? This is problematic in a 3-tier environment, because how should the proxy be materialized on the client side? (by the way, try to set useAutoCommit=3D"0") But I don't know = what's the reason for your exhausted con-pool, maybe a side-effect of the proxy use? regards, Armin > Thoughts? I apologize in advance if this is a stupid configuration=20 > issue. >=20 > -Andrew >=20 > Here is my OJB repository datasource description: >=20 > jcd-alias=3D"devsql" > default-connection=3D"true" > platform=3D"MsSQLServer" > jdbc-level=3D"3.0" > jndi-datasource-name=3D"java:MsSqlDevDS" > useAutoCommit=3D"2" > > > class=3D"org.apache.ojb.broker.cache.ObjectCacheDefaultImpl"> > > attribute-value=3D"true"/> > > =09 > =20 > = className=3D"org.apache.ojb.broker.util.sequence.SequenceManagerMSSQLGui > dI > mpl" /> >=20 > >=20 > Here is my jBoss Datasource descriptor: >=20 > > > MsSqlDevDS > =20 > jdbc:inetdae7:192.168.2.30:1433? ur > l> > com.inet.tds.TdsDriver > 5 > 30 > 1 > select 1 > > >=20 > And here is the error stack: >=20 > 12:29:49,906 ERROR [org.jboss.web.localhost.Engine] > StandardWrapperValve[org.osn.webapp.jcore.doclib.docview_jsp]: > Servlet.service() for servlet org.osn.webapp.jcore.doclib.docview_jsp > threw exception > org.apache.ojb.broker.PersistenceBrokerException: > org.apache.ojb.broker.PersistenceBrokerException: > org.apache.ojb.broker.PersistenceBrokerException: Used=20 > ConnectionManager instance could not obtain a connection > at > org.apache.ojb.broker.accesslayer.CollectionProxy.loadData(CollectionP > ro > xy.java:158) > at > org.apache.ojb.broker.accesslayer.ListProxy.loadData(ListProxy.java:187) > at > org.apache.ojb.broker.accesslayer.CollectionProxy.getData(CollectionPr > ox > y.java:401) > at > org.apache.ojb.broker.accesslayer.CollectionProxy.iterator(CollectionP > ro > xy.java:230) > at > org.osn.bom.Document.getCurrentDocumentVersion(Document.java:274) > Caused by: org.apache.ojb.broker.PersistenceBrokerException: > org.apache.ojb.broker.PersistenceBrokerException: Used=20 > ConnectionManager instance could not obtain a connection > at > org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Q > ue > ryReferenceBroker.java:250) > at > org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery( > Pe > rsistenceBrokerImpl.java:1012) > at > org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionBy > Qu > ery(DelegatingPersistenceBroker.java:312) > at > org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionBy > Qu > ery(DelegatingPersistenceBroker.java:312) > at > org.apache.ojb.broker.accesslayer.CollectionProxy.loadData(CollectionP > ro > xy.java:148) > ... 51 more > Caused by: org.apache.ojb.broker.PersistenceBrokerException: Used=20 > ConnectionManager instance could not obtain a connection > at > org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatemen > t( > StatementManager.java:680) > at > org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAcce > ss > Impl.java:315) > at > org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryOb > je > ct.java:113) > at > org.apache.ojb.broker.accesslayer.RsIterator.(RsIterator.java:211) > at > org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(RsIt > er > atorFactoryImpl.java:97) > at > org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuer > y( > PersistenceBrokerImpl.java:1631) > at > org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery( > Pe > rsistenceBrokerImpl.java:1136) > at > org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Q > ue > ryReferenceBroker.java:143) > at > org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Q > ue > ryReferenceBroker.java:242) > ... 55 more > Caused by: org.apache.ojb.broker.accesslayer.LookupException: > SQLException thrown while trying to get Connection from Datasource > (java:MsSqlDevDS) > at > org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newCon > ne > ctionFromDataSource(ConnectionFactoryAbstractImpl.java:200) > at > org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookup > Co > nnection(ConnectionFactoryAbstractImpl.java:97) > at > org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl.lookupC > on > nection(ConnectionFactoryManagedImpl.java:18) > at > org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection( > Co > nnectionManagerImpl.java:144) > at > org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatemen > t( > StatementManager.java:676) > ... 63 more > Caused by: org.jboss.util.NestedSQLException: No ManagedConnections=20 > available within configured blocking timeout ( 5000 [ms] ); - nested > throwable: (javax.resource.ResourceException: No ManagedConnections=20 > available within configured blocking timeout ( 5000 [ms] )) > at > org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrappe > rD > ataSource.java:106) > at > org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newCon > ne > ctionFromDataSource(ConnectionFactoryAbstractImpl.java:189) > ... 67 more > Caused by: javax.resource.ResourceException: No ManagedConnections=20 > available within configured blocking timeout ( 5000 [ms] ) > at > org.jboss.resource.connectionmanager.InternalManagedConnectionPool.get > Co > nnection(InternalManagedConnectionPool.java:250) > at > org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePo > ol > .getConnection(JBossManagedConnectionPool.java:496) > at > org.jboss.resource.connectionmanager.BaseConnectionManager2.getManaged > Co > nnection(BaseConnectionManager2.java:425) > at > org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCon > ne > ction(TxConnectionManager.java:318) > at > org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateCo > nn > ection(BaseConnectionManager2.java:477) > at > org.jboss.resource.connectionmanager.BaseConnectionManager2$Connection > Ma > nagerProxy.allocateConnection(BaseConnectionManager2.java:814) > at > org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrappe > rD > ataSource.java:102) > ... 68 more >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For=20 > additional commands, e-mail: ojb-dev-help@db.apache.org >=20 >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org