Forum OpenACS Q&A: Re: querying multiple datababe server..

Posted by Andrew Piskorski on
Jerome, if it's just that you can't figure out how to use the ns_db API, you need to read and practice more. Perhaps look at the old OpenACS 3.x code for lots of ns_db examples.

However, it's not that hard to to a pretty cleanly modify the OpenACS db_* ABI to let you use it on multiple database, and database you have an AOLserver database driver loaded and configured for. I did it for ACS 4.2 - see this thread.

I will volunteer to do a further cleaned up and better tested version of that for OpenACS when I have time, probably for 4.7, or perhaps a later maintenance release of 4.6.x (as the changes can be made entirely backwards compatible).

But if you really need something like that now, take a look at my old 4.2 code, and let me know if you have questions.

Posted by Jerome M on
hi, i was used to using the ns_db API, and since i got the OACS it seems to me using ns_db API isnt appropriate to use anymore because of the db_* API.. (or i might be wrong)

i tried downloading your files and replaced the ones ported with OACS4.5 hmm..OACS4.5 modules/services AFAIK doesnt know how to use your code so that will be a problem.. hehehe

is there a way to use the db_* API to query a diff DB server (diff pool) because all queries default to the default pool listed in the config file..