Connect to multiple databases at one time?

Sten-Erik Björling s-e.bjorling at enviro.se
Thu Jan 20 09:22:17 UTC 2022


Hi Das,

I use session pools for this and in the most extreme situations I use dynamic assignment of the DBs for the pools depending on the DB choice of the clients - demands generic SQL and no stored process etc. though…

There are some advantages to session pools:

- You can dedicate session pools for different purposes - read-only is one example that allows the DB to not involve costly record locking during access etc.
- Session pools allows the number of connections to the DB to be kept down - good in more heavily used systems.
- Session pools also allows for very compact programming and effective use of worker objects.

The disadvantage at this point using session pools is if implementing the multi-core Omnis app server - will demand routines to keep the number of sessions available in the pool to a functional minimum.

In both cases - utilise the Yield to other threads command at relevant sections of your code. One tick represents about 17 milliseconds and many searches and interactions with your database system delivers results to an app-server faster than that. Also in remote forms - set the maxPollDelay to 1 to trigger a fast refresh at the client side of the subform containing the data.

Take care, all the best…

Stene

______

> 19 jan. 2022 kl. 23:47 skrev Mike Matthews - Omnis via omnisdev-en <omnisdev-en at lists.omnis-dev.com>:
> 
> an you connect to multiple SQL databases at one time together?
> 
> Or only one at a time, and you switch back and forth to do multiple?
> _________________________________________________________



More information about the omnisdev-en mailing list