roxen.lists.roxen.general

Subject Author Date
DB sessions in a single RXML page reuses the same connection? Stephen R. van den Berg <srb[at]cuci[dot]nl> 05-01-2009
I was recently trying to sync my own Roxen patches with the bleeding edge
5.0 Roxen, and noticed a *lot* of clashes in the SQL handling of Roxen.
Browsing the logs I find snippets like:

commit 34b4c862df454bd554abf00952412f08e738b24f
Author: mast <mast>
Date:   Fri Sep 23 20:00:22 2005 +0000

    Added a flag to DBManager.get() to facilitate SQL connection reuse
    within the same thread.

Does that mean that Roxen natively now guarantees that the SQL session is
going to be reused when accessed from within a single RXML page?
I.e. if, in one page, I do:

	<sqlquery query="CREATE TEMPORARY TABLE abc (a INT);" />
	<sqlquery query="INSERT INTO abc VALUES (12);" />
	<emit source=sql query="SELECT a FROM abc;">
         xx &_.a:; xx
        </emit>
	<sqlquery query="DROP TABLE abc;" />

I am guaranteed a meaningful result?
I.e. it is not possible for a different RXML page to briefly hijack the
connection between those four queries?

If that is an affirmative, then I can simply strip out my kludges; if not,
it means a bit of work to get it synced.
-- 
Sincerely,
           Stephen R. van den Berg.

"Well, if we're going to make a party of it, let's nibble Nobby's nuts!"