Author: damitha
Date: Thu Feb  7 06:28:27 2008
New Revision: 619426

URL: http://svn.apache.org/viewvc?rev=619426&view=rev
Log:
Moved database creation function call from handlers into mod_sandesha2.c

Modified:
    webservices/sandesha/trunk/c/config/module.xml
    webservices/sandesha/trunk/c/src/core/mod_sandesha2.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c
    webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c

Modified: webservices/sandesha/trunk/c/config/module.xml
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/module.xml?rev=619426&r1=619425&r2=619426&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/config/module.xml (original)
+++ webservices/sandesha/trunk/c/config/module.xml Thu Feb  7 06:28:27 2008
@@ -81,7 +81,7 @@
     <parameter name="MaxRetransCount" locked="false">10</parameter>
     <parameter name="SenderSleepTime" locked="false">100000</parameter><!--In 
micro seconds-->
     <parameter name="InvokerSleepTime" locked="false">1</parameter>
-    <parameter name="PollingWaitTime" locked="false">3</parameter>
+    <parameter name="PollingWaitTime" locked="false">2</parameter>
     <parameter name="TerminateDelay" locked="false">2</parameter>
 
 </module>

Modified: webservices/sandesha/trunk/c/src/core/mod_sandesha2.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/core/mod_sandesha2.c?rev=619426&r1=619425&r2=619426&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/core/mod_sandesha2.c (original)
+++ webservices/sandesha/trunk/c/src/core/mod_sandesha2.c Thu Feb  7 06:28:27 
2008
@@ -72,7 +72,6 @@
     axutil_param_t *param = NULL;
     axis2_conf_t *conf = NULL;
     axis2_ctx_t *ctx = NULL;
-    /*sandesha2_storage_mgr_t *storage_mgr = NULL;*/
     
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
"[sandesha2]Entry:mod_sandesha2_init");
     AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
@@ -97,14 +96,10 @@
     axis2_ctx_set_property(ctx, env, SANDESHA2_INMEMORY_STORAGE_MGR, NULL);
     axis2_ctx_set_property(ctx, env, SANDESHA2_PERMANENT_STORAGE_MGR, NULL);
     
-    /*storage_mgr = sandesha2_utils_get_inmemory_storage_mgr(env, conf_ctx);
-    sandesha2_storage_mgr_init_storage(storage_mgr, env, module_desc);*/
-    
-    /*sandesha2_storage_mgr_t *storage_mgr = 
sandesha2_utils_get_permanent_storage_mgr(env, conf_ctx);
-    sandesha2_storage_mgr_init_storage(storage_mgr, env, module_desc);
     if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
-        return AXIS2_FAILURE;*/
-    
+    {
+        return AXIS2_FAILURE;
+    }
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
"[sandesha2]Exit:mod_sandesha2_init");
     return AXIS2_SUCCESS;
 }

Modified: 
webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c?rev=619426&r1=619425&r2=619426&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c 
(original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_global_in_handler.c Thu 
Feb  7 06:28:27 2008
@@ -240,11 +240,7 @@
             }
         }
     }
-    /*if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
-    {
-        return AXIS2_FAILURE;
-    }
-    rm_msg_ctx = sandesha2_msg_init_init_msg(env, msg_ctx);*/
+    /*rm_msg_ctx = sandesha2_msg_init_init_msg(env, msg_ctx);*/
     /*if(!isolated_last_msg)
         dropped = sandesha2_global_in_handler_drop_if_duplicate(handler, env, 
             rm_msg_ctx);

Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c?rev=619426&r1=619425&r2=619426&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_in_handler.c Thu Feb  7 
06:28:27 2008
@@ -95,10 +95,10 @@
                 AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
+    /*if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
     {
         return AXIS2_FAILURE;
-    }
+    }*/
     ctx = axis2_msg_ctx_get_base(msg_ctx, env);
     temp_prop = axis2_ctx_get_property(ctx, env, 
         SANDESHA2_APPLICATION_PROCESSING_DONE);

Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c?rev=619426&r1=619425&r2=619426&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c Thu Feb  
7 06:28:27 2008
@@ -126,10 +126,10 @@
     axis2_msg_ctx_set_property(msg_ctx, env, 
         SANDESHA2_APPLICATION_PROCESSING_DONE, temp_prop);
     conf = axis2_conf_ctx_get_conf(conf_ctx, env);
-    if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
+    /*if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
     {
         return AXIS2_FAILURE;
-    }
+    }*/
     /* Getting rm message */ 
     rm_msg_ctx = sandesha2_msg_init_init_msg(env, msg_ctx);
     temp_prop = axis2_msg_ctx_get_property(msg_ctx, env, 
SANDESHA2_CLIENT_DUMMY_MESSAGE);

Modified: 
webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c?rev=619426&r1=619425&r2=619426&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c 
(original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c Thu 
Feb  7 06:28:27 2008
@@ -1068,6 +1068,12 @@
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
         "[sandesha2]Entry:sandesha2_permanent_storage_mgr_create_db");
     dbname = sandesha2_util_get_dbname(env, conf_ctx);
+    if(AXIS2_SUCCESS == axutil_file_handler_access(dbname, AXIS2_F_OK))
+    {
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+            "[sandesha2]Database %s already created.", dbname);
+        return AXIS2_SUCCESS;
+    }
     dbconn = sandesha2_permanent_bean_mgr_get_dbconn(env, 
         dbname);
     #if !defined(WIN32)
@@ -1117,7 +1123,7 @@
                 "SQL Error: %s", error_msg);
             sqlite3_free(error_msg);
             sqlite3_close(dbconn);
-            return AXIS2_SUCCESS;
+            return AXIS2_FAILURE;
         }
         rc = sqlite3_exec(dbconn, sql_stmt2, NULL, 0, &error_msg);
         if( rc != SQLITE_OK )
@@ -1127,7 +1133,7 @@
                 error_msg);
             sqlite3_free(error_msg);
             sqlite3_close(dbconn);
-            /*return AXIS2_FAILURE;*/
+            return AXIS2_FAILURE;
         }
         rc = sqlite3_exec(dbconn, sql_stmt3, NULL, 0, &error_msg);
         if( rc != SQLITE_OK )
@@ -1137,7 +1143,7 @@
                 error_msg);
             sqlite3_free(error_msg);
             sqlite3_close(dbconn);
-            /*return AXIS2_FAILURE;*/
+            return AXIS2_FAILURE;
         }
         rc = sqlite3_exec(dbconn, sql_stmt4, NULL, 0, &error_msg);
         if( rc != SQLITE_OK )
@@ -1147,7 +1153,7 @@
                 error_msg);
             sqlite3_free(error_msg);
             sqlite3_close(dbconn);
-            /*return AXIS2_FAILURE;*/
+            return AXIS2_FAILURE;
         }
         rc = sqlite3_exec(dbconn, sql_stmt5, NULL, 0, &error_msg);
         if( rc != SQLITE_OK )
@@ -1158,7 +1164,7 @@
                 error_msg);
             sqlite3_free(error_msg);
             sqlite3_close(dbconn);
-            /*return AXIS2_FAILURE;*/
+            return AXIS2_FAILURE;
         }
         rc = sqlite3_exec(dbconn, sql_stmt6, NULL, 0, &error_msg);
         if( rc != SQLITE_OK )
@@ -1168,7 +1174,7 @@
                 error_msg);
             sqlite3_free(error_msg);
             sqlite3_close(dbconn);
-            /*return AXIS2_FAILURE;*/
+            return AXIS2_FAILURE;
         }
         rc = sqlite3_exec(dbconn, sql_stmt7, NULL, 0, &error_msg);
         if( rc != SQLITE_OK )
@@ -1178,7 +1184,7 @@
                 error_msg);
             sqlite3_free(error_msg);
             sqlite3_close(dbconn);
-            /*return AXIS2_FAILURE;*/
+            return AXIS2_FAILURE;
         }
         sqlite3_close(dbconn);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to