Hi Armin,

I'm using OJB 1.0.rc4.

Looking though the code I see that in one instance the following code is
used:

...
        Transaction tx = TxManagerFactory.instance().getTransaction();
        PBCapsule capsule = new PBCapsule(((OJB)
SessionFactory.getInstance().getOdmg()).getCurrentPBKey(), tx);
        PersistenceBroker broker = getPBCapsule().getBroker();
        result = (ManageableCollection) broker.getCollectionByQuery(query);
        return result;
...

I believe this might be causing the broker-pool to become exhausted.  I have
modified this to call capsule.destroy() before returning and will test this.

Many thanks for your help.

Carlos.


Armin Waibel wrote:
> Hi Carlos,
> 
> seems the broker-pool is exhausted.
> 
> OJB version?
> 
> Do you mix PB-api and ODMG-api in your code?
> I don't mean
>  > PersistenceBroker broker = ((HasBroker) tx).getBroker();
> that's ok. I mean direct use of PersistenceBrokerFactory
> to create PB instances?
> 
> Normally the odmg-api close all used PB instances
> after use.
> 
> Or, you have to many concurrent threads running on the server.
> But default pool size is 100.
> So I think it's not as simple as that ;-)
> 
> regards,
> Armin
> 
> Boyes, Carl wrote:
> > Hi,
> > 
> > Our OJB based application has just gone into system test and we are
> > intermittently experiencing the below error when calling:
> > PersistenceBroker broker = ((HasBroker) tx).getBroker();
> > 
> > Can anyone let me know what I am doing wrong?  Is there 
> another way to get
> > the broker from a transaction?  Should I be calling any 
> specific clean up
> > method?
> > 
> > As always any help would be much appreciated.
> > 
> > ----
> > [org.apache.ojb.odmg.TransactionImpl] ERROR: Cannot obtain 
> PersistenceBroker
> > from PersistenceBrokerFactory, found PBKey was 
> org.apache.ojb.broker.PBKey:
> > jcdAlias=Xdeals, user=gemini_object, password=*****
> > Borrow broker from pool failed
> > java.util.NoSuchElementException
> >     at
> > 
> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObje
> ct(GenericKeye
> > dObjectPool.java:758)
> >     at
> > 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
> .createPersist
> > enceBroker(PersistenceBrokerFactoryDefaultImpl.java:233)
> >     at
> > 
> org.apache.ojb.broker.PersistenceBrokerFactory.createPersisten
> ceBroker(Persi
> > stenceBrokerFactory.java:131)
> >     at
> > 
> org.apache.ojb.odmg.TransactionImpl.getBroker(TransactionImpl.
> java:1201)
> > ----
> > 
> > Carlos.
> > 
> > 
> > 
> > The contents of this email are confidential to the intended 
> recipient at the email address to which it has been 
> addressed.  It may not be disclosed to or used by anyone 
> other than this addressee, nor may it be copied in any way. 
> If received in error, please contact DLA, a UK law firm, 
(http://www.dla.com/) on +44 (0) 8700 111111 quoting the name of the sender
and the addressee and then delete it from your system.
>  
> Please note that neither DLA nor the sender accepts any responsibility for
viruses and it is your responsibility to scan the email and attachments (if
any).  No contracts may be concluded on behalf of DLA by means of email
communications.
> 
> A list of the names of the partners of DLA (who are either solicitors or
registered foreign lawyers) and their qualifications is available for
inspection at 3 Noble Street, London, EC2V 7EE, UK.
> 
> Regulated by the Law Society.
> 
> 
> 
> ---------------------------------------------------------------------
> 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]


The contents of this email are confidential to the intended recipient at the email 
address to which it has been addressed.  It may not be disclosed to or used by anyone 
other than this addressee, nor may it be copied in any way. If received in error, 
please contact DLA, a UK law firm, (http://www.dla.com/) on +44 (0) 8700 111111 
quoting the name of the sender and the addressee and then delete it from your system.
 
Please note that neither DLA nor the sender accepts any responsibility for viruses and 
it is your responsibility to scan the email and attachments (if any).  No contracts 
may be concluded on behalf of DLA by means of email communications.

A list of the names of the partners of DLA (who are either solicitors or registered 
foreign lawyers) and their qualifications is available for inspection at 3 Noble 
Street, London, EC2V 7EE, UK.

Regulated by the Law Society.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to