Hi,
----- Original Message -----
From: "McCaffrey, John G." <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Friday, July 11, 2003 6:43 PM
Subject: Broker threading
> I was wondering how most people handle getting a Broker obj. Do you
get a
> new one each time, or a singleton, or what?
> I have a serviceLocator.findBroker() that basically returns a new one
each
> time.
> PBKey pbKey = new PBKey("default");
why not only create PBKey once (for the same jcdAlias)
> broker = PersistenceBrokerFactory.createPersistenceBroker(pbKey);
>
This only obtain a broker instance from the broker-pool
> I see that it creates my sequenceManager for each db call, and I
didn't
> think I really needed to be doing that.
each PersistenceBroker instance use its own SequenceManager
instance.
> So when you guys get a
> persistenceBroker reference, are you getting a new one each time, or
do you
> pass around one reference? Are there threading or performance issues
to be
> concerned about?
PB itself is not threadsafe, thus handle one PB instance
per thread (and do PB.close() to return PB to PB-pool).
regards,
Armin
>
> Thanks for your help,
> -John
>
> ---------------------------------------------------------------------
> 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]