aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2013-12-11 14:57:54 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2013-12-11 14:57:54 -0500
commita8459c0104ca36fd058ea527890116c7a1bca8fd (patch)
tree00c51911af9b45c7c29ef1ba89f02a3d49f0fd69 /src/cjr_print.sml
parenta22814f0ea7501eba5dc86413ba9851e97deed2e (diff)
Fix regression in http.c for long-polling connections; add lazy initialization of database connections, to avoid the overhead in handlers that don't use SQL
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index bc8f1be6..e98918e6 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -2079,6 +2079,8 @@ and p_exp' par tail env (e, loc) =
newline,
string "int dummy = (uw_begin_region(ctx), 0);",
newline,
+ string "uw_ensure_transaction(ctx);",
+ newline,
case prepared of
NONE =>
@@ -2140,6 +2142,8 @@ and p_exp' par tail env (e, loc) =
p_exp' false false env dml,
string ";",
newline,
+ string "uw_ensure_transaction(ctx);",
+ newline,
newline,
#dml (Settings.currentDbms ()) (loc, mode)]
| SOME {id, dml = dml'} =>
@@ -2159,8 +2163,10 @@ and p_exp' par tail env (e, loc) =
string ";"])
inputs,
newline,
+ string "uw_ensure_transaction(ctx);",
newline,
-
+ newline,
+
#dmlPrepared (Settings.currentDbms ()) {loc = loc,
id = id,
dml = dml',
@@ -2184,6 +2190,8 @@ and p_exp' par tail env (e, loc) =
newline,
string "uw_Basis_int n;",
newline,
+ string "uw_ensure_transaction(ctx);",
+ newline,
case prepared of
NONE => #nextval (Settings.currentDbms ()) {loc = loc,
@@ -2204,6 +2212,8 @@ and p_exp' par tail env (e, loc) =
| ESetval {seq, count} =>
box [string "({",
newline,
+ string "uw_ensure_transaction(ctx);",
+ newline,
#setval (Settings.currentDbms ()) {loc = loc,
seqE = p_exp' false false env seq,