Author: samisa
Date: Mon Feb 26 08:41:40 2007
New Revision: 511885

URL: http://svn.apache.org/viewvc?view=rev&rev=511885
Log:
Fixed the response problems for the single channel case and also detecting the 
non-engaged status of the module

Modified:
    webservices/sandesha/trunk/c/config/module.xml
    webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c
    webservices/sandesha/trunk/c/src/workers/sender.c
    webservices/sandesha/trunk/c/src/workers/sender_worker.c

Modified: webservices/sandesha/trunk/c/config/module.xml
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/module.xml?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/config/module.xml (original)
+++ webservices/sandesha/trunk/c/config/module.xml Mon Feb 26 08:41:40 2007
@@ -68,7 +68,7 @@
     </operation>
 
    <!-- Database connection parameters -->
-   <parameter name="sandesha2_db" locked="false">/axis2c/deploy</parameter>
+   <parameter name="sandesha2_db" locked="false">/tmp</parameter>
    <!-- General parameters -->
     <parameter name="ExponentialBackoff" locked="false">AXIS2_TRUE</parameter>
     <parameter name="RetransmissionInterval" locked="false">20000</parameter>

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?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c Mon Feb 
26 08:41:40 2007
@@ -119,6 +119,27 @@
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SVC_NULL, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
+    else
+    {
+        axis2_qname_t *mod_qname = axis2_qname_create(env, "sandesha2", NULL, 
NULL);
+        axis2_array_list_t *mod_qnames = AXIS2_SVC_GET_ALL_MODULE_QNAMES(svc, 
env);
+        int size = axis2_array_list_size(mod_qnames, env);
+        int i = 0;  
+        axis2_bool_t found = AXIS2_FALSE;
+        for (i = 0; i < size; i++)
+        {
+            axis2_qname_t *qname = NULL;
+            qname = AXIS2_ARRAY_LIST_GET(mod_qnames, env, i);
+            if (qname)
+            {
+                found = axis2_qname_equals(mod_qname, env, qname);
+                if (found)
+                    break;
+            }
+        }
+        if (!found)
+            return AXIS2_SUCCESS;
+    }
     temp_prop = axis2_msg_ctx_get_property(msg_ctx, env, 
             SANDESHA2_APPLICATION_PROCESSING_DONE, AXIS2_FALSE);
     if(temp_prop)

Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Mon Feb 
26 08:41:40 2007
@@ -38,6 +38,7 @@
 #include <sandesha2_sender_mgr.h>
 #include <sandesha2_sender_bean.h>
 
+#include <axis2_const.h>
 #include <axis2_msg_ctx.h>
 #include <axis2_string.h>
 #include <axis2_engine.h>
@@ -243,6 +244,8 @@
     }
     
     op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op_ctx is %p", op_ctx);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op_ctx parent is %p", 
AXIS2_OP_CTX_GET_PARENT(op_ctx, env));
     axis2_op_ctx_set_response_written(op_ctx, env, AXIS2_TRUE);
     conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx, 
@@ -566,6 +569,14 @@
     /* end test code */
     AXIS2_LOG_INFO(env->log, 
         "[sandesha2] Exit: sandesha2_app_msg_processor_process_in_msg");
+
+    {
+        axis2_svc_ctx_t *svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env);
+        axis2_ctx_t *ctx = AXIS2_SVC_CTX_GET_BASE((const axis2_svc_ctx_t 
*)svc_ctx, env);
+        AXIS2_CTX_SET_PROPERTY(ctx, env, AXIS2_RESPONSE_SOAP_ENVELOPE, 
+            axis2_property_create_with_args(env, 0, 0, 0, 
+            (void*)axis2_msg_ctx_get_soap_envelope(msg_ctx, env)), 
AXIS2_FALSE);
+    }
     return AXIS2_SUCCESS;
     
 }
@@ -612,6 +623,8 @@
     msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
     conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
     op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op_ctx is %p", op_ctx);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op_ctx parent is %p", 
AXIS2_OP_CTX_GET_PARENT(op_ctx, env));
     req_msg_ctx = AXIS2_OP_CTX_GET_MSG_CTX(op_ctx, env, 
         AXIS2_WSDL_MESSAGE_LABEL_IN);
     /* TODO setting up fault callback */

Modified: 
webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c 
(original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c 
Mon Feb 26 08:41:40 2007
@@ -264,13 +264,17 @@
     /*if(rc == SQLITE_BUSY)
         rc = sandesha2_permanent_bean_mgr_busy_handler(trans_impl->dbconn, 
             "COMMIT TRANSACTION;", 0, 0, &error_msg, rc);*/
-    if(rc != SQLITE_OK )
+    while(rc != SQLITE_OK )
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SQL_ERROR, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sql error %s",
             error_msg);
         printf("commit error_msg:%s\n", error_msg);
         sqlite3_free(error_msg);
+        AXIS2_SLEEP(1);
+        sqlite3_close(trans_impl->dbconn);
+        sandesha2_permanent_transaction_release_locks(trans, env);
+        rc = sqlite3_exec(trans_impl->dbconn, "COMMIT TRANSACTION;", 0, 0, 
&error_msg);
     }
     sqlite3_close(trans_impl->dbconn);
     trans_impl->is_active = AXIS2_FALSE;

Modified: webservices/sandesha/trunk/c/src/workers/sender.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender.c?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender.c Mon Feb 26 08:41:40 2007
@@ -243,6 +243,7 @@
     axis2_env_t *env = NULL;
     sandesha2_storage_mgr_t *storage_mgr = NULL;
     sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
+    int count = 0;
     
     args = (sandesha2_sender_args_t*)data;
     env = axis2_init_thread_env(args->env);
@@ -272,6 +273,9 @@
         if(!sender_bean)
         {
             sandesha2_transaction_commit(transaction, env);
+            count++;
+            if (count > 5)
+                break;
             continue;
         }
         msg_id = sandesha2_sender_bean_get_msg_id((sandesha2_rm_bean_t *) 

Modified: webservices/sandesha/trunk/c/src/workers/sender_worker.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender_worker.c?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Mon Feb 26 
08:41:40 2007
@@ -24,7 +24,6 @@
 #include <sandesha2_seq_property_mgr.h>
 #include <sandesha2_msg_ctx.h>
 #include <sandesha2_seq.h>
-#include <sandesha2_client_constants.h>
 #include <axis2_addr.h>
 #include <axis2_engine.h>
 #include <stdlib.h>
@@ -599,12 +598,10 @@
          AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
 
     res_envelope = axis2_msg_ctx_get_response_soap_envelope(msg_ctx, env);
-    if(!res_envelope)
-    {
+    /*if(!res_envelope)
         res_envelope = axis2_http_transport_utils_create_soap_msg(env, msg_ctx,
             soap_ns_uri);
-        axis2_msg_ctx_set_response_soap_envelope(msg_ctx, env, res_envelope);
-    }
+    */
     property = axis2_msg_ctx_get_property(msg_ctx, env, 
         SANDESHA2_WITHIN_TRANSACTION, AXIS2_FALSE);
     if(property)
@@ -612,13 +609,6 @@
     if(new_property)
         axis2_msg_ctx_set_property(res_msg_ctx, env, 
             SANDESHA2_WITHIN_TRANSACTION, new_property, AXIS2_FALSE);
-    property = axis2_msg_ctx_get_property(msg_ctx, env, 
-        SANDESHA2_CLIENT_SEQ_KEY, AXIS2_FALSE);
-    if(property)
-        new_property = axis2_property_clone(property, env);
-    if(new_property)
-        axis2_msg_ctx_set_property(res_msg_ctx, env, 
-            SANDESHA2_CLIENT_SEQ_KEY, new_property, AXIS2_FALSE);
     if(res_envelope)
     {
         axis2_engine_t *engine = NULL;



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

Reply via email to