Author: damitha
Date: Thu Jan 18 21:33:14 2007
New Revision: 497707

URL: http://svn.apache.org/viewvc?view=rev&rev=497707
Log:
Fixed a windows problem.

Modified:
    webservices/sandesha/trunk/c/src/client/client.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
    webservices/sandesha/trunk/c/src/util/terminate_mgr.c
    webservices/sandesha/trunk/c/src/workers/sender.c
    webservices/sandesha/trunk/c/src/workers/sender_worker.c

Modified: webservices/sandesha/trunk/c/src/client/client.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/client.c?view=diff&rev=497707&r1=497706&r2=497707
==============================================================================
--- webservices/sandesha/trunk/c/src/client/client.c (original)
+++ webservices/sandesha/trunk/c/src/client/client.c Thu Jan 18 21:33:14 2007
@@ -260,8 +260,10 @@
     }
     if(!within_transaction)
     {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         report_transaction = 
sandesha2_storage_mgr_get_transaction(storage_mgr, 
             env);
+        axis2_allocator_switch_to_local_pool(env->allocator);
     }
     SANDESHA2_SEQ_REPORT_SET_INTERNAL_SEQ_ID(seq_report, env, internal_seq_id);
     create_seq_find_bean = sandesha2_create_seq_bean_create(env);
@@ -417,7 +419,9 @@
     }
     if(AXIS2_TRUE != within_transaction)
     {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         report_transaction = 
sandesha2_storage_mgr_get_transaction(storage_mgr, env);
+        axis2_allocator_switch_to_local_pool(env->allocator);
     }
     if(internal_seq_find_bean) 
         sandesha2_seq_property_bean_set_name(internal_seq_find_bean, env, 
@@ -1571,8 +1575,10 @@
     }
     if(!within_transaction)
     {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         report_transaction = 
sandesha2_storage_mgr_get_transaction(storage_mgr, 
-                env);
+            env);
+        axis2_allocator_switch_to_local_pool(env->allocator);
     }
     seq_report = sandesha2_seq_report_create(env);
     completed_msg_list = sandesha2_ack_mgr_get_svr_completed_msgs_list(env, 
@@ -1670,8 +1676,10 @@
         {
             seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
                 storage_mgr, env);
+            axis2_allocator_switch_to_global_pool(env->allocator);
             transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, 
                 env);
+            axis2_allocator_switch_to_local_pool(env->allocator);
         }
         if(seq_prop_mgr)
             seq_id_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, 
env, 

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=497707&r1=497706&r2=497707
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Thu Jan 
18 21:33:14 2007
@@ -241,8 +241,10 @@
         }
     }
     conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+    axis2_allocator_switch_to_global_pool(env->allocator);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx, 
         AXIS2_CONF_CTX_GET_CONF(conf_ctx, env));
+    axis2_allocator_switch_to_local_pool(env->allocator);
     fault_ctx = sandesha2_fault_mgr_check_for_last_msg_num_exceeded(
         env, rm_msg_ctx, storage_mgr);
     if(fault_ctx)
@@ -526,9 +528,11 @@
     req_msg_ctx = AXIS2_OP_CTX_GET_MSG_CTX(op_ctx, env, 
         AXIS2_WSDL_MESSAGE_LABEL_IN);
     /* TODO setting up fault callback */
-    
+
+    axis2_allocator_switch_to_global_pool(env->allocator);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx,
-                        AXIS2_CONF_CTX_GET_CONF(conf_ctx, env));
+        AXIS2_CONF_CTX_GET_CONF(conf_ctx, env));
+    axis2_allocator_switch_to_local_pool(env->allocator);
     seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
                         storage_mgr, env);
     if(!seq_prop_mgr)

Modified: 
webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c?view=diff&rev=497707&r1=497706&r2=497707
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c 
(original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c 
Thu Jan 18 21:33:14 2007
@@ -242,29 +242,14 @@
     storage_mgr_impl->SANDESHA2_MSG_MAP_KEY = 
AXIS2_STRDUP("Sandesha2MessageMap", 
         env);
     storage_mgr_impl->conf_ctx = conf_ctx;
-    /*storage_mgr_impl->db = NULL;
-    storage_mgr_impl->db_name = NULL;*/
     storage_mgr_impl->transactions = axis2_hash_make(env);
     storage_mgr_impl->bean_mgr = NULL;
     storage_mgr_impl->mutex = axis2_thread_mutex_create(env->allocator,
         AXIS2_THREAD_MUTEX_DEFAULT);
+    axis2_allocator_switch_to_global_pool(env->allocator);
     storage_mgr_impl->msg_ctx_map = axis2_hash_make(env);
+    axis2_allocator_switch_to_local_pool(env->allocator);
     conf = AXIS2_CONF_CTX_GET_CONF((const axis2_conf_ctx_t *) conf_ctx, env);
-    /*prop_bean = sandesha2_utils_get_property_bean(env, conf);
-    path = sandesha2_property_bean_get_db_path(prop_bean, env);
-    storage_mgr_impl->db_name = axis2_strcat(env, path, AXIS2_PATH_SEP_STR, 
-        "sandesha2", NULL);
-    storage_mgr_impl->rc = sqlite3_open(storage_mgr_impl->db_name, 
-        &(storage_mgr_impl->db));
-    if(rc)
-    {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Can't open database: %s\n", 
-            sqlite3_errmsg(storage_mgr_impl->db));
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CANNOT_OPEN_DATABASE, 
-            AXIS2_FAILURE);
-        sqlite3_close(storage_mgr_impl->db);
-        return NULL;
-    }*/
     storage_mgr_impl->bean_mgr = sandesha2_permanent_bean_mgr_create(env,
         &(storage_mgr_impl->storage_mgr), conf_ctx, NULL);
     storage_mgr_impl->create_seq_mgr = 
sandesha2_permanent_create_seq_mgr_create(
@@ -301,7 +286,6 @@
     sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
     storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
 
-    /*sqlite3_close(storage_mgr_impl->db);*/
     if(storage_mgr_impl->transactions)
     {
         axis2_hash_free(storage_mgr_impl->transactions, env);
@@ -360,7 +344,7 @@
     axis2_hash_index_t *index = NULL;
     sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
     unsigned long *thread_id;
-       int key_len = sizeof(unsigned long);
+    axis2_char_t *thread_id_key = NULL;
 
        storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
        thread_id = (unsigned long *) axis2_os_thread_current();
@@ -381,14 +365,16 @@
         }
 
     }
+    thread_id_key = AXIS2_MALLOC(env->allocator, 128);
+    sprintf(thread_id_key, "%ld", thread_id); 
     transaction = (sandesha2_transaction_t *) axis2_hash_get(
-        storage_mgr_impl->transactions, thread_id, key_len);
+        storage_mgr_impl->transactions, thread_id_key, AXIS2_HASH_KEY_STRING);
     if(!transaction)
     {
         transaction = 
             sandesha2_permanent_transaction_create(env, storage_mgr, 
thread_id);
-        axis2_hash_set(storage_mgr_impl->transactions, thread_id, 
-            key_len, transaction);
+        axis2_hash_set(storage_mgr_impl->transactions, thread_id_key, 
+            AXIS2_HASH_KEY_STRING, transaction);
     }
     axis2_thread_mutex_unlock(storage_mgr_impl->mutex);
     return transaction;
@@ -402,13 +388,15 @@
 {
     sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
     unsigned long *thread_id = NULL;
-    int key_len = sizeof(unsigned long);
+    axis2_char_t *thread_id_key = AXIS2_MALLOC(env->allocator, 128);
     storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
 
     axis2_thread_mutex_lock(storage_mgr_impl->mutex);
     thread_id = (unsigned long *) 
sandesha2_permanent_transaction_get_thread_id(
         transaction, env);
-    axis2_hash_set(storage_mgr_impl->transactions, thread_id, key_len, NULL);
+    sprintf(thread_id_key, "%ld", thread_id); 
+    axis2_hash_set(storage_mgr_impl->transactions, thread_id_key, 
+        AXIS2_HASH_KEY_STRING, NULL);
     axis2_thread_mutex_unlock(storage_mgr_impl->mutex);
 }
 
@@ -524,8 +512,10 @@
     sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
     storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
 
+    axis2_allocator_switch_to_global_pool(env->allocator);
     axis2_hash_set(storage_mgr_impl->msg_ctx_map, key, AXIS2_HASH_KEY_STRING, 
         msg_ctx);
+    axis2_allocator_switch_to_local_pool(env->allocator);
     AXIS2_MSG_CTX_SET_KEEP_ALIVE(msg_ctx, env, AXIS2_TRUE);
     msg_store_bean = sandesha2_permanent_storage_mgr_get_msg_store_bean(
         storage_mgr, env, msg_ctx);
@@ -555,6 +545,7 @@
     void *entry = NULL;
     sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
     storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
+    axis2_allocator_switch_to_global_pool(env->allocator);
     if(storage_mgr_impl->msg_ctx_map)
         entry = axis2_hash_get(storage_mgr_impl->msg_ctx_map, key, 
             AXIS2_HASH_KEY_STRING);
@@ -563,6 +554,7 @@
         axis2_hash_set(storage_mgr_impl->msg_ctx_map, key, 
             AXIS2_HASH_KEY_STRING, NULL);
     }
+    axis2_allocator_switch_to_local_pool(env->allocator);
     sandesha2_permanent_bean_mgr_remove_msg_store_bean(
         storage_mgr_impl->bean_mgr, env, key);
     return AXIS2_SUCCESS;
@@ -947,7 +939,7 @@
             AXIS2_MSG_CTX_SET_OP_CTX(msg_ctx, env, op_ctx);
             /*AXIS2_OP_CTX_ADD_MSG_CTX(op_ctx, env, msg_ctx);*/
             msg_id = (axis2_char_t *) AXIS2_MSG_CTX_GET_MSG_ID(msg_ctx, env);
-            AXIS2_CONF_CTX_REGISTER_OP_CTX(conf_ctx, env, msg_id, op_ctx);
+            /*AXIS2_CONF_CTX_REGISTER_OP_CTX(conf_ctx, env, msg_id, op_ctx);*/
         }
     }
     AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, 
@@ -1133,17 +1125,20 @@
 {
     sqlite3* dbconn = NULL;
     sandesha2_transaction_t *transaction = NULL;
-    int key_len = sizeof(unsigned long);
     unsigned long *thread_id = (unsigned long *) axis2_os_thread_current();
+    axis2_char_t thread_id_key[128];
     sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
     storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
     /*axis2_thread_mutex_lock(storage_mgr_impl->mutex);*/
+    sprintf(thread_id_key, "%ld", thread_id);
     transaction = (sandesha2_transaction_t *) axis2_hash_get(
-        storage_mgr_impl->transactions, thread_id, key_len);
+        storage_mgr_impl->transactions, thread_id_key, AXIS2_HASH_KEY_STRING);
     /*transaction = 
sandesha2_permanent_storage_mgr_get_transaction(storage_mgr, 
         env);*/
     if(transaction)
+    {
         dbconn = (sqlite3 *) 
sandesha2_permanent_transaction_get_dbconn(transaction, env);
+    }
     /*axis2_thread_mutex_unlock(storage_mgr_impl->mutex);*/
     return dbconn;
 }

Modified: webservices/sandesha/trunk/c/src/util/terminate_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/terminate_mgr.c?view=diff&rev=497707&r1=497706&r2=497707
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Thu Jan 18 21:33:14 
2007
@@ -85,7 +85,9 @@
     
     if(!sandesha2_terminate_mgr_rcv_side_clean_map)
     {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         sandesha2_terminate_mgr_rcv_side_clean_map = axis2_hash_make(env);
+        axis2_allocator_switch_to_local_pool(env->allocator);
     }
     
     prop_bean = sandesha2_utils_get_property_bean(env, AXIS2_CONF_CTX_GET_CONF(
@@ -93,17 +95,21 @@
     in_order_invoke = sandesha2_property_bean_is_in_order(prop_bean, env);
     if(!in_order_invoke)
     {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         axis2_hash_set(sandesha2_terminate_mgr_rcv_side_clean_map, seq_id,
             AXIS2_HASH_KEY_STRING, AXIS2_STRDUP(
                 SANDESHA2_CLEANED_ON_TERMINATE_MSG, env));
+        axis2_allocator_switch_to_local_pool(env->allocator);
         sandesha2_terminate_mgr_clean_recv_side_after_invocation(env, conf_ctx,
                     seq_id, storage_mgr);
     }
     else
     {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         axis2_char_t *clean_status = axis2_hash_get(
             sandesha2_terminate_mgr_rcv_side_clean_map, seq_id, 
             AXIS2_HASH_KEY_STRING);
+        axis2_allocator_switch_to_local_pool(env->allocator);
         if(clean_status && 0 == AXIS2_STRCMP(clean_status, 
                     SANDESHA2_CLEANED_AFTER_INVOCATION))
         {
@@ -111,9 +117,13 @@
                     storage_mgr);
         }
         else
+        {
+            axis2_allocator_switch_to_global_pool(env->allocator);
             axis2_hash_set(sandesha2_terminate_mgr_rcv_side_clean_map, seq_id,
                     AXIS2_HASH_KEY_STRING, AXIS2_STRDUP(
                     SANDESHA2_CLEANED_ON_TERMINATE_MSG, env));
+            axis2_allocator_switch_to_local_pool(env->allocator);
+        }
     }
     AXIS2_LOG_INFO(env->log, 
         
"[sandesha2]Exit:sandesha2_terminate_mgr_clean_recv_side_after_terminate_msg");
@@ -142,7 +152,9 @@
     
     if(!sandesha2_terminate_mgr_rcv_side_clean_map)
     {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         sandesha2_terminate_mgr_rcv_side_clean_map = axis2_hash_make(env);
+        axis2_allocator_switch_to_local_pool(env->allocator);
     }
     
     invoker_mgr = sandesha2_storage_mgr_get_storage_map_mgr(storage_mgr, env);
@@ -165,8 +177,10 @@
             sandesha2_invoker_bean_get_msg_ctx_ref_key((sandesha2_rm_bean_t *) 
                 map_bean, env));
     }
+    axis2_allocator_switch_to_global_pool(env->allocator);
     clean_status = axis2_hash_get(sandesha2_terminate_mgr_rcv_side_clean_map,
         seq_id, AXIS2_HASH_KEY_STRING);
+    axis2_allocator_switch_to_local_pool(env->allocator);
                     
     if(clean_status && 0 == AXIS2_STRCMP(clean_status, 
         SANDESHA2_CLEANED_ON_TERMINATE_MSG))
@@ -175,9 +189,13 @@
                     storage_mgr);
     }
     else
+    {
+        axis2_allocator_switch_to_global_pool(env->allocator);
         axis2_hash_set(sandesha2_terminate_mgr_rcv_side_clean_map, seq_id,
             AXIS2_HASH_KEY_STRING, AXIS2_STRDUP(
                 SANDESHA2_CLEANED_AFTER_INVOCATION, env));
+        axis2_allocator_switch_to_local_pool(env->allocator);
+    }
 
     
     AXIS2_LOG_INFO(env->log, 

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=497707&r1=497706&r2=497707
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender.c Thu Jan 18 21:33:14 2007
@@ -264,8 +264,10 @@
         axis2_char_t *msg_id = NULL;
         printf("in sender\n");   
         AXIS2_SLEEP(SANDESHA2_SENDER_SLEEP_TIME); 
+        axis2_allocator_switch_to_global_pool(env->allocator);
         transaction = sandesha2_storage_mgr_get_transaction(storage_mgr,
             env);
+        axis2_allocator_switch_to_local_pool(env->allocator);
         mgr = sandesha2_storage_mgr_get_retrans_mgr(storage_mgr, env);
         seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
             storage_mgr, env);

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=497707&r1=497706&r2=497707
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Thu Jan 18 
21:33:14 2007
@@ -234,7 +234,9 @@
     storage_mgr = sandesha2_utils_get_storage_mgr(env, 
         sender_worker->conf_ctx, 
         AXIS2_CONF_CTX_GET_CONF(sender_worker->conf_ctx, env));
+    axis2_allocator_switch_to_global_pool(env->allocator);
     transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, env);
+    axis2_allocator_switch_to_local_pool(env->allocator);
     sender_mgr = sandesha2_storage_mgr_get_retrans_mgr(storage_mgr, env);
     sender_worker_bean = sandesha2_sender_mgr_retrieve(sender_mgr, env, 
msg_id);
     if(!sender_worker_bean)
@@ -377,8 +379,9 @@
         sleep(300000);*/
                     
     }
-    transaction = sandesha2_storage_mgr_get_transaction(storage_mgr,
-                    env);
+    axis2_allocator_switch_to_global_pool(env->allocator);
+    transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, env);
+    axis2_allocator_switch_to_local_pool(env->allocator);
     property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, 
         SANDESHA2_WITHIN_TRANSACTION, AXIS2_FALSE); 
     if(property)



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

Reply via email to