Hi Armin and Micheal,

I'm using ODMG in the same way as Micheal. I had this problem before too,
not sure if I'm still getting this now (using OJB 0.9.9)

In OJB 0.9.5/6 (not remember exactly), if I did a lot of updates at a very
short period of time, I found that the PB crashed very easily once an
exception was thrown within a transaction, then being catched, and rollback.
After getting a few exceptions in the same place, the log (log4j) told the
number of PB instances were increased quickly, like it increased per each
new request. I guess that the old PB instance might take some resource and
blocked, and the deadlock might occurred! The situation got better as I
debugged my code to avoid those exceptions. I don't remember what were those
exceptions in details, may be Micheal faces something similar now

Wonder how does OJB determine to create an extra instance?

Thomas
----- Original Message -----
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Sunday, March 23, 2003 1:51 AM
Subject: Re: Connection Pool


> Hi Michael,
>
> seems ok for me.
> When do you get the broker pool crash,
> how many threads do access your singleton?
>
> Which version do you use?
>
> Do increase the broker pool size in OJB.properties file?
>
> regards,
> Armin
>
> > I'm actually using ODMG.  Maybe I'm not using it properly.  I have one
> > service class that does all the OJB work.  In that class I do
> something
> > like this in the constructor:
> >
> > odmg = OJB.getInstance();
> > Database db = odmg.newDatabase();
> >
> > try {
> >     db.open("default", Database.OPEN_READ_WRITE);
> > } catch (ODMGException e) {
> >     e.printStackTrace();
> > }
> >
> > The class is a singleton.  Then in each method (let's say for updates)
> I
> > do something like this:
> >
> > Transaction tx = null;
> > try {
> >     tx = odmg.newTransaction();
> >     tx.begin();
> >
> > ... some work
> >
> > tx.commit();
> > } finally {
> > tx.rollback();
> > }
> >
> > Am I doing that correctly?  Should I not be using ODMG?  Any help is
> > appreciated.
> >
> > Thanks
> > Michael
> >
> >
> > -----Original Message-----
> > From: Armin Waibel [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, March 22, 2003 9:47 AM
> > To: OJB Users List
> > Subject: Re: Connection Pool
> >
> > Hi Michael,
> >
> > ----- Original Message -----
> > From: "Michael Buchsbaum" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > Sent: Saturday, March 22, 2003 2:08 PM
> > Subject: Connection Pool
> >
> >
> > > Has anyone had any problem with the connection pool crashing when
> > doing
> > > large updates with relationships?
> >
> > AFAIK you are the first.
> >
> > > I'm using MySQL.  I get the error message
> > > "Borrow broker from pool failed"
> >
> > Not the connection pool, the PersistenceBroker pool
> > crashed.
> > When using the PB-api, do you close the
> > broker after use?
> >
> > e.g.
> > PersistenceBroker broker;
> > {
> > broker  = PersistenceBrokerFactory.createPersistenceBroker(myPBKey);
> > ...
> > do something
> > ....
> > }
> > finally
> > {
> > // return broker instance to pool
> > if(broker != null) broker.close();
> > }
> >
> > This isn't the problem? Then some more
> > details would be useful.
> >
> > regards,
> > Armin
> > >
> > > Thanks
> > > Michael
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > > 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]

Reply via email to