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.
|
|
|
|
|
SQL refactored, adding per-thread option, added second SQLR
By: mirek on Sat, 10 December 2011 17:10
|
|
|
Re: SQL refactored, adding per-thread option, added second SQLR
By: mirek on Tue, 28 February 2012 10:39
|
|
|
Re: SQL refactored, adding per-thread option, added second SQLR
By: BioBytes on Tue, 28 February 2012 11:14
|
|
|
Re: SQL refactored, adding per-thread option, added second SQLR
By: mirek on Tue, 28 February 2012 12:09
|
|
|
Re: SQL refactored, adding per-thread option, added second SQLR
By: bushman on Mon, 10 December 2012 00:10
|
|
|
Re: SQL refactored, adding per-thread option, added second SQLR
By: mirek on Mon, 10 December 2012 05:24
|
Goto Forum:
Current Time: Wed May 08 05:51:43 CEST 2024
Total time taken to generate the page: 0.02816 seconds
|