[Greater-commits] r289 - trunk/GREAT-ER-DB/impl/postgresql

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jun 27 18:14:45 CEST 2011


Author: bricks
Date: 2011-06-27 18:14:44 +0200 (Mon, 27 Jun 2011)
New Revision: 289

Modified:
   trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
Fix indentation
Fix gda_cleanup_temp_sess day interval handling


Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc	2011-06-27 16:05:10 UTC (rev 288)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc	2011-06-27 16:14:44 UTC (rev 289)
@@ -13674,7 +13674,7 @@
 
     /* not used:
     struct DA_T_sess_pg_i{   // indicator variables for host variable struct
-  	short int  sess_id;
+   	short int  sess_id;
    	short int  catch_id;
    	short int  subst_id;
    	short int  env_id;
@@ -13725,15 +13725,16 @@
   EXEC SQL SET CONNECTION TO :h_con_name;
 
   errln = 10;
+  /* delete session older then 7 days and web sessions older then 3 days */
   EXEC SQL DECLARE temp_sess_csr CURSOR FOR
             SELECT SESS_ID, 
                    TEMP_SESS_DB_SID,
-		   IS_TEMP_SESS
+                   IS_TEMP_SESS
               FROM SESS_TAB
-             WHERE ((IS_TEMP_SESS = 'Y' AND MOD_DATE < (CURRENT_TIMESTAMP-7)) OR
-		    (IS_TEMP_SESS = 'W' AND MOD_DATE < (CURRENT_TIMESTAMP-3))    )
-               AND USER_ID = :h_user_id;
-	       
+                 WHERE ((IS_TEMP_SESS = 'Y' AND MOD_DATE < (CURRENT_TIMESTAMP - interval '7 days')) OR
+                 (IS_TEMP_SESS = 'W' AND MOD_DATE < (CURRENT_TIMESTAMP - interval '3 days')) )
+                 AND USER_ID = :h_user_id;
+
   errln = 20;
   EXEC SQL OPEN temp_sess_csr;
   
@@ -13746,11 +13747,11 @@
      errln = 40;
      EXEC SQL FETCH temp_sess_csr  INTO :h_sess_id          INDICATOR :h_ind_sess_id,
                                         :h_temp_sess_db_sid INDICATOR :h_ind_temp_sess_db_sid,
-					:h_is_temp_sess     INDICATOR :h_ind_is_temp_sess;
+                                        :h_is_temp_sess     INDICATOR :h_ind_is_temp_sess;
 
      /* delete web temporary session without alive check */
-	 errln = 50;
-	 
+     errln = 50;
+
      if (h_is_temp_sess == DA_WEB)
      {
         v_status = gda_delete_sess( db_con, h_sess_id, vp_errinfo);



More information about the Greater-commits mailing list