[Mpuls-commits] r5999 - base/trunk/mpulsweb/controllers

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Tue Jul 10 16:41:08 CEST 2012


Author: bh
Date: 2012-07-10 16:41:08 +0200 (Tue, 10 Jul 2012)
New Revision: 5999

Modified:
   base/trunk/mpulsweb/controllers/evaluate.py
Log:
Move the getConnection call out of the try-finally.

The finally clause is used to recycle the connection returned by
getConnection. However, that is only possible if the getConnection call
is successful, the getConnection call itself must not be inside the
try-block.

This problem, a failing getConnection call in the method
EvaluateController.evaluateAction, actually happens occasionally in
practice, for some reason (for instance in WASKA).


Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2012-06-28 12:38:54 UTC (rev 5998)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2012-07-10 14:41:08 UTC (rev 5999)
@@ -318,9 +318,10 @@
         # Build evaluation
         eval_params = self._get_evalparams(form_result, session.get("id_field"),
                                            session.get("sql_where"))
+
+        conn = db.getConnection()
         try:
             try:
-                conn = db.getConnection()
                 evalconfig = EvaluationConfig(config_file, conn,
                                               eval_params['start_date'],
                                               eval_params['end_date'],



More information about the Mpuls-commits mailing list