Hi Robert,

[EMAIL PROTECTED] wrote:
My OJB application uses multiple PersistenceBrokers to access different
databases.  The only way I could do it was by calling
PersistenceBrokerThreadMapping.setCurrentPersistenceBroker(<broker>);
because the app was running in its one thread.

Sorry, think I don't understand the problem. You can lookup several PB instances each access a different DB.


http://db.apache.org/ojb/docu/faq.html#lookupPB
http://db.apache.org/ojb/docu/faq.html#multipleDB

I was just wondering if you spawned multiple threads, each with its own
broker, and each broker accessing different databases .... could you get
your app to get data from the brokers in each thread?

yep, no problem (or if you don't think so, please describe the problem more detailed - code snip). Lookup an PB instance in each thread using a PBKey to specify the DB (using jcdAlias name defined in jdbc-connection-descriptor). Use the PB to do the work and immediately close the PB after use.



 And would it be
faster or more efficient than what I'm doing now?  (it works fine, but I'm
worried about dealing with memory and run time issues)

Not sure what you are doing (sharing one PB instance in your app?), but I strongly advise against using internal non-api classes.


regards,
Armin


--Bobby


--------------------------------------------------------------------- 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