Home » Community » U++ community news and announcements » SQL refactored, adding per-thread option, added second SQLR
SQL refactored, adding per-thread option, added second SQLR [message #34760] |
Sat, 10 December 2011 17:10 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
SQL, 'global SQL session/cursor', is now refactored so that each thread is allowed to assign its own SqlSession to SQL.
Unless this is assigned, SQL defaults to 'global SQL', the first one that was assigned.
This way, it is possible to support both "single DB session per whole program" (only main thread assigns SQL) - in that case using SQL has to be serialized (mutexes). And it is also possible to have per-thread SQL (if thread assigns it).
I have also noticed that there is quite common pattern to use two SQL sessions - one for read/write master DB, second for read-only slaves. Read operations are then performed on slaves, which unloads master DB.
So support this, I have introduced secondary 'global cursor/session', SQLR. If not assigned, it defaults to session defined for SQL. Of course, global/per-thread behaviour is the same.
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Mar 29 16:07:23 CET 2024
Total time taken to generate the page: 0.01748 seconds
|