Armin,
Thanks for getting back to me.
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]