Author: damitha
Date: Thu May  8 01:54:39 2008
New Revision: 654450

URL: http://svn.apache.org/viewvc?rev=654450&view=rev
Log:
Fixing SANDESHA2C-50

Modified:
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c

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?rev=654450&r1=654449&r2=654450&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Thu May  
8 01:54:39 2008
@@ -632,6 +632,7 @@
         {
             axis2_char_t *int_seq_id = NULL;
             axis2_char_t *out_seq_id = NULL;
+            long highest_out_msg_no = 0;
             
             /* If there is a sequence acknowledgement element present in the 
sequence we will check
              * whether the sequence is completed. If so send a terminate 
sequence message.
@@ -644,28 +645,33 @@
                 SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NO, seq_prop_mgr);
             if(last_out_msg_no_str)
             {
-                long highest_out_msg_no = 0;
                 highest_out_msg_no = atol(last_out_msg_no_str);
                 if(last_out_msg_no_str)
                     AXIS2_FREE(env->allocator, last_out_msg_no_str);
+            }
+            else
+            {
+                highest_out_msg_no = 
sandesha2_app_msg_processor_get_prev_msg_no(env, 
+                    int_seq_id, seq_prop_mgr);
+            }
+            if(highest_out_msg_no > 0)
+            {
+                axis2_bool_t completed = AXIS2_FALSE;
+                axutil_array_list_t *ack_range_list = NULL;
+
                 AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"highest_out_msg_no:%ld", highest_out_msg_no);
-                if(highest_out_msg_no > 0)
-                {
-                    axis2_bool_t completed = AXIS2_FALSE;
-                    axutil_array_list_t *ack_range_list = NULL;
 
-                    ack_range_list = 
sandesha2_seq_ack_get_ack_range_list(seq_ack, env);
-                    completed = sandesha2_ack_mgr_verify_seq_completion(env, 
-                        ack_range_list, highest_out_msg_no);
-                    if(completed)
-                    {
-                        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
-                                "[sandesha2]Sequence %s is completed. So 
adding terminate msg", 
-                                out_seq_id); 
-                        sandesha2_terminate_mgr_add_terminate_seq_msg(env, 
rm_msg_ctx, 
-                            out_seq_id, int_seq_id, storage_mgr, seq_prop_mgr, 
-                            create_seq_mgr, sender_mgr);
-                    }
+                ack_range_list = sandesha2_seq_ack_get_ack_range_list(seq_ack, 
env);
+                completed = sandesha2_ack_mgr_verify_seq_completion(env, 
+                    ack_range_list, highest_out_msg_no);
+                if(completed)
+                {
+                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+                            "[sandesha2]Sequence %s is completed. So adding 
terminate msg", 
+                            out_seq_id); 
+                    sandesha2_terminate_mgr_add_terminate_seq_msg(env, 
rm_msg_ctx, 
+                        out_seq_id, int_seq_id, storage_mgr, seq_prop_mgr, 
+                        create_seq_mgr, sender_mgr);
                 }
             }
         }

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=654450&r1=654449&r2=654450&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 
May  8 01:54:39 2008
@@ -1184,9 +1184,13 @@
             return AXIS2_FAILURE;
         }
         sqlite3_close(dbconn);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Created the 
database %s successfully", dbname);
     }
     else
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Database %s 
creation failed", dbname);
         return AXIS2_FAILURE;
+    }
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
         "[sandesha2]Exit:sandesha2_permanent_storage_mgr_create_db");
     return AXIS2_SUCCESS;



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

Reply via email to