Author: damitha
Date: Sat Jan 20 03:40:16 2007
New Revision: 498103
URL: http://svn.apache.org/viewvc?view=rev&rev=498103
Log:
Fixed a bug regarding getting the current thread id
Modified:
webservices/sandesha/trunk/c/include/sandesha2_permanent_transaction.h
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c
webservices/sandesha/trunk/c/src/util/msg_creator.c
webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
webservices/sandesha/trunk/c/src/wsrm/acks_to.c
webservices/sandesha/trunk/c/src/wsrm/create_seq.c
webservices/sandesha/trunk/c/src/wsrm/seq_offer.c
Modified: webservices/sandesha/trunk/c/include/sandesha2_permanent_transaction.h
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_permanent_transaction.h?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_permanent_transaction.h
(original)
+++ webservices/sandesha/trunk/c/include/sandesha2_permanent_transaction.h Sat
Jan 20 03:40:16 2007
@@ -41,14 +41,14 @@
sandesha2_permanent_transaction_create(
const axis2_env_t *env,
struct sandesha2_storage_mgr *storage_mgr,
- unsigned long *thread_id);
+ unsigned long int thread_id);
sqlite3 * AXIS2_CALL
sandesha2_permanent_transaction_get_dbconn(
struct sandesha2_transaction *transaction,
const axis2_env_t *env);
-unsigned long *AXIS2_CALL
+unsigned long int AXIS2_CALL
sandesha2_permanent_transaction_get_thread_id(
struct sandesha2_transaction *transaction,
const axis2_env_t *env);
Modified:
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
Sat Jan 20 03:40:16 2007
@@ -221,6 +221,7 @@
env, SANDESHA2_MSG_PART_CREATE_SEQ_RESPONSE);
seq_offer = sandesha2_create_seq_get_seq_offer(create_seq_part,
env);
+ printf("seq_offer:%s\n", seq_offer);
/* Offer processing */
if(seq_offer)
{
@@ -240,9 +241,11 @@
}
offer_seq_id = sandesha2_identifier_get_identifier(
sandesha2_seq_offer_get_identifier(seq_offer, env),
env);
+ printf("offer_seq_id:%s\n", offer_seq_id);
offer_accepted = sandesha2_create_seq_msg_processor_offer_accepted(
env, offer_seq_id, rm_msg_ctx,
storage_mgr);
+ printf("offer_accepted:%d\n", offer_accepted);
if(offer_accepted)
{
sandesha2_create_seq_bean_t *create_seq_bean = NULL;
Modified:
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
---
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
(original)
+++
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
Sat Jan 20 03:40:16 2007
@@ -539,10 +539,12 @@
AXIS2_OP_SET_IN_FLOW(out_in_op, env,
AXIS2_OP_GET_IN_FLOW(old_op, env));
+ axis2_allocator_switch_to_global_pool(env->allocator);
op_ctx = axis2_op_ctx_create(env, out_in_op, NULL);
AXIS2_OP_CTX_SET_PARENT(op_ctx, env, AXIS2_MSG_CTX_GET_SVC_CTX(msg_ctx,
env));
- /*axis2_conf_ctx_register_op_ctx(conf_ctx, env,
sandesha2_msg_ctx_get_msg_id(
- rm_msg_ctx, env), op_ctx);*/
+ axis2_conf_ctx_register_op_ctx(conf_ctx, env, sandesha2_msg_ctx_get_msg_id(
+ rm_msg_ctx, env), op_ctx);
+ axis2_allocator_switch_to_local_pool(env->allocator);
if(terminated && 0 == AXIS2_STRCMP(terminated, SANDESHA2_VALUE_TRUE))
{
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=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
(original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_storage_mgr.c
Sat Jan 20 03:40:16 2007
@@ -343,11 +343,11 @@
sandesha2_transaction_t *transaction = NULL;
axis2_hash_index_t *index = NULL;
sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- unsigned long int *thread_id;
+ unsigned long int thread_id;
axis2_char_t *thread_id_key = NULL;
storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- thread_id = (unsigned long int *) axis2_os_thread_current();
+ thread_id = (unsigned long int ) axis2_os_thread_current();
axis2_thread_mutex_lock(storage_mgr_impl->mutex);
@@ -366,7 +366,7 @@
}
thread_id_key = AXIS2_MALLOC(env->allocator, 128);
- sprintf(thread_id_key, "%lu", *thread_id);
+ sprintf(thread_id_key, "%lu", thread_id);
transaction = (sandesha2_transaction_t *) axis2_hash_get(
storage_mgr_impl->transactions, thread_id_key, AXIS2_HASH_KEY_STRING);
if(!transaction)
@@ -387,14 +387,14 @@
sandesha2_transaction_t *transaction)
{
sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- unsigned long int *thread_id = NULL;
+ unsigned long int thread_id = NULL;
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 int *)
sandesha2_permanent_transaction_get_thread_id(
+ thread_id = (unsigned long int)
sandesha2_permanent_transaction_get_thread_id(
transaction, env);
- sprintf(thread_id_key, "%lu", *thread_id);
+ sprintf(thread_id_key, "%lu", 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);
@@ -931,16 +931,18 @@
if(op)
{
axis2_svc_ctx_t *svc_ctx = AXIS2_MSG_CTX_GET_SVC_CTX(msg_ctx, env);
+ axis2_allocator_switch_to_global_pool(env->allocator);
axis2_op_ctx_t *op_ctx = axis2_op_ctx_create(env, op, svc_ctx);
if(op_ctx)
{
- /*axis2_char_t *msg_id = NULL;*/
+ axis2_char_t *msg_id = NULL;
AXIS2_OP_CTX_SET_PARENT(op_ctx, env, svc_ctx);
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);*/
+ 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_allocator_switch_to_local_pool(env->allocator);
}
AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env,
sandesha2_msg_store_bean_is_svr_side(msg_store_bean, env));
@@ -1125,12 +1127,12 @@
{
sqlite3* dbconn = NULL;
sandesha2_transaction_t *transaction = NULL;
- unsigned long int *thread_id = (unsigned long int *)
axis2_os_thread_current();
+ unsigned long int thread_id = (unsigned long int)
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, "%lu", *thread_id);
+ sprintf(thread_id_key, "%lu", thread_id);
transaction = (sandesha2_transaction_t *) axis2_hash_get(
storage_mgr_impl->transactions, thread_id_key, AXIS2_HASH_KEY_STRING);
/*transaction =
sandesha2_permanent_storage_mgr_get_transaction(storage_mgr,
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=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c
(original)
+++ webservices/sandesha/trunk/c/src/storage/permanent/permanent_transaction.c
Sat Jan 20 03:40:16 2007
@@ -45,7 +45,7 @@
axis2_thread_mutex_t *mutex;
sqlite3 *dbconn;
axis2_bool_t is_active;
- unsigned long *thread_id;
+ unsigned long int thread_id;
};
#define SANDESHA2_INTF_TO_IMPL(trans) \
@@ -90,7 +90,7 @@
sandesha2_permanent_transaction_create(
const axis2_env_t *env,
sandesha2_storage_mgr_t *storage_mgr,
- unsigned long *thread_id)
+ unsigned long int thread_id)
{
sandesha2_permanent_transaction_impl_t *trans_impl = NULL;
axis2_char_t *error_msg = NULL;
@@ -201,7 +201,7 @@
return trans_impl->dbconn;
}
-unsigned long *AXIS2_CALL
+unsigned long int AXIS2_CALL
sandesha2_permanent_transaction_get_thread_id(
sandesha2_transaction_t *trans,
const axis2_env_t *env)
@@ -240,7 +240,7 @@
trans_impl = SANDESHA2_INTF_TO_IMPL(trans);
rc = sqlite3_exec(trans_impl->dbconn, "COMMIT TRANSACTION;", 0, 0,
&error_msg);
- /*unsigned long *thread_id = (unsigned long *) axis2_os_thread_current();
+ /*unsigned long int thread_id = (unsigned long int)
axis2_os_thread_current();
printf("came2:thread_id:%ld\n", thread_id);*/
/*if(rc == SQLITE_BUSY)
rc = sandesha2_permanent_bean_mgr_busy_handler(trans_impl->dbconn,
@@ -269,7 +269,7 @@
trans_impl = SANDESHA2_INTF_TO_IMPL(trans);
rc = sqlite3_exec(trans_impl->dbconn, "ROLLBACK TRANSACTION;", 0, 0,
&error_msg);
- /*unsigned long *thread_id = (unsigned long *) axis2_os_thread_current();
+ /*unsigned long int thread_id = (unsigned long int)
axis2_os_thread_current();
printf("came3:thread_id:%ld\n", thread_id);*/
if(rc != SQLITE_OK )
{
@@ -319,7 +319,7 @@
sandesha2_rm_bean_t *rm_bean)
{
sandesha2_rm_bean_t *rm_bean_l = NULL;
- unsigned long *thread_id = NULL;
+ unsigned long int thread_id = -1;
sandesha2_permanent_transaction_impl_t *trans_impl = NULL;
AXIS2_LOG_INFO(env->log,
"[sandesha2]Start:sandesha2_permanent_transaction_enlist");
@@ -329,13 +329,13 @@
if(rm_bean)
{
sandesha2_transaction_t *other = NULL;
- unsigned long *other_thread_id = NULL;
+ unsigned long int other_thread_id = -1;
axis2_thread_mutex_lock(trans_impl->mutex);
other = sandesha2_rm_bean_get_transaction(rm_bean_l, env);
if(other)
other_thread_id =
sandesha2_permanent_transaction_get_thread_id(other,
env);
- while(other && *other_thread_id != *thread_id)
+ while(other && other_thread_id != thread_id)
{
int size = 0;
if(trans_impl->enlisted_beans)
Modified: webservices/sandesha/trunk/c/src/util/msg_creator.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_creator.c?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Sat Jan 20 03:40:16 2007
@@ -138,8 +138,9 @@
create_seq_op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(create_seq_msg_ctx, env);
create_seq_msg_id = axis2_uuid_gen(env);
AXIS2_MSG_CTX_SET_MESSAGE_ID(create_seq_msg_ctx, env, create_seq_msg_id);
- AXIS2_CONF_CTX_REGISTER_OP_CTX(ctx, env, create_seq_msg_id,
- create_seq_op_ctx);
+ axis2_allocator_switch_to_global_pool(env->allocator);
+ axis2_conf_ctx_register_op_ctx(ctx, env, create_seq_msg_id,
create_seq_op_ctx);
+ axis2_allocator_switch_to_local_pool(env->allocator);
app_msg_op_desc = AXIS2_MSG_CTX_GET_OP(application_msg_ctx, env);
create_seq_op = AXIS2_MSG_CTX_GET_OP(create_seq_msg_ctx, env);
if(app_msg_op_desc)
@@ -521,9 +522,11 @@
terminate_seq_op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(terminate_seq_msg_ctx,
env);
terminate_seq_msg_id = (axis2_char_t*)AXIS2_MSG_CTX_GET_MSG_ID(
terminate_seq_msg_ctx, env);
+ axis2_allocator_switch_to_global_pool(env->allocator);
if(terminate_seq_msg_id)
- AXIS2_CONF_CTX_REGISTER_OP_CTX(conf_ctx, env, terminate_seq_msg_id,
+ axis2_conf_ctx_register_op_ctx(conf_ctx, env, terminate_seq_msg_id,
terminate_seq_op_ctx);
+ axis2_allocator_switch_to_local_pool(env->allocator);
ref_msg_op = AXIS2_MSG_CTX_GET_OP(ref_msg_ctx, env);
terminate_seq_op = AXIS2_MSG_CTX_GET_OP(terminate_seq_msg_ctx, env);
if(ref_msg_op)
Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Sat Jan 20 03:40:16
2007
@@ -710,8 +710,10 @@
AXIS2_OP_SET_PARENT(op, env, svc);
}
+ axis2_allocator_switch_to_global_pool(env->allocator);
op_ctx = axis2_op_ctx_create(env, op, AXIS2_MSG_CTX_GET_SVC_CTX(new_msg,
- env));
+ env));
+ axis2_allocator_switch_to_local_pool(env->allocator);
AXIS2_MSG_CTX_SET_OP_CTX(new_msg, env, op_ctx);
AXIS2_OP_CTX_ADD_MSG_CTX(op_ctx, env, new_msg);
Modified: webservices/sandesha/trunk/c/src/wsrm/acks_to.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/acks_to.c?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/acks_to.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/acks_to.c Sat Jan 20 03:40:16 2007
@@ -81,9 +81,9 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY,
AXIS2_FAILURE);
return NULL;
}
- acks_to_impl->rm_ns_val = NULL;
- acks_to_impl->addr_ns_val = NULL;
- acks_to_impl->address = NULL;
+ acks_to_impl->rm_ns_val = (axis2_char_t *)AXIS2_STRDUP(rm_ns_val, env);
+ acks_to_impl->addr_ns_val = (axis2_char_t *)AXIS2_STRDUP(addr_ns_val, env);
+ acks_to_impl->address = address;
acks_to_impl->acks_to.element.ops = AXIS2_MALLOC(env->allocator,
sizeof(sandesha2_iom_rm_element_ops_t));
@@ -95,10 +95,6 @@
return NULL;
}
- acks_to_impl->rm_ns_val = (axis2_char_t *)AXIS2_STRDUP(rm_ns_val, env);
- acks_to_impl->addr_ns_val = (axis2_char_t *)AXIS2_STRDUP(addr_ns_val, env);
- acks_to_impl->address = address;
-
acks_to_impl->acks_to.element.ops->get_namespace_value =
sandesha2_acks_to_get_namespace_value;
acks_to_impl->acks_to.element.ops->from_om_node =
Modified: webservices/sandesha/trunk/c/src/wsrm/create_seq.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/create_seq.c?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/create_seq.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/create_seq.c Sat Jan 20 03:40:16 2007
@@ -94,8 +94,8 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY,
AXIS2_FAILURE);
return NULL;
}
- create_seq_impl->rm_ns_val = NULL;
- create_seq_impl->addr_ns_val = NULL;
+ create_seq_impl->rm_ns_val = (axis2_char_t*)AXIS2_STRDUP(rm_ns_val, env);
+ create_seq_impl->addr_ns_val = (axis2_char_t*)AXIS2_STRDUP(addr_ns_val,
env);
create_seq_impl->acks_to = NULL;
create_seq_impl->expires = NULL;
create_seq_impl->seq_offer = NULL;
@@ -120,10 +120,7 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
-
- create_seq_impl->rm_ns_val = (axis2_char_t*)AXIS2_STRDUP(rm_ns_val, env);
- create_seq_impl->addr_ns_val = (axis2_char_t*)AXIS2_STRDUP(addr_ns_val,
env);
-
+
create_seq_impl->create_seq.part.element.ops->get_namespace_value =
sandesha2_create_seq_get_namespace_value;
create_seq_impl->create_seq.part.element.ops->from_om_node =
@@ -240,8 +237,10 @@
}
offer_part = AXIOM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(seq_part, env,
offer_qname, seq_node, &offer_node);
+ printf("came1\n");
if(offer_part)
{
+ printf("came2\n");
create_seq_impl->seq_offer = sandesha2_seq_offer_create(env,
create_seq_impl->rm_ns_val);
if(!create_seq_impl->seq_offer)
Modified: webservices/sandesha/trunk/c/src/wsrm/seq_offer.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/seq_offer.c?view=diff&rev=498103&r1=498102&r2=498103
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/seq_offer.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/seq_offer.c Sat Jan 20 03:40:16 2007
@@ -83,11 +83,11 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY,
AXIS2_FAILURE);
return NULL;
}
- seq_offer_impl->ns_val = NULL;
+ seq_offer_impl->ns_val = (axis2_char_t *)AXIS2_STRDUP(ns_val, env);
seq_offer_impl->identifier = NULL;
seq_offer_impl->expires = NULL;
seq_offer_impl->seq_offer.element.ops = NULL;
-
+ printf("ns_val:%s\n", seq_offer_impl->ns_val);
seq_offer_impl->seq_offer.element.ops = AXIS2_MALLOC(env->allocator,
sizeof(sandesha2_iom_rm_element_ops_t));
if(NULL == seq_offer_impl->seq_offer.element.ops)
@@ -97,7 +97,6 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- seq_offer_impl->ns_val = (axis2_char_t *)AXIS2_STRDUP(ns_val, env);
seq_offer_impl->seq_offer.element.ops->get_namespace_value =
sandesha2_seq_offer_get_namespace_value;
@@ -244,6 +243,7 @@
}
rm_ns = axiom_namespace_create(env, seq_offer_impl->ns_val,
SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
+ printf("seq_offer_impl->ns_val:%s\n", seq_offer_impl->ns_val);
if(NULL == rm_ns)
{
return NULL;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]