Re: Issue in using 'detach' for cloning

2008-02-22 Thread Samisa Abeysinghe
Bill Mitchell wrote: Hello Senaka, No, existing axiom_node_detach calls do not need to change. They can all stay the same, and in general they need to stay the same in order to receive the fix that the detached tree declares all the namespaces that it references. One of the concerns raised

Re: Issue in using 'detach' for cloning

2008-02-21 Thread Dinesh Premalal
Hi, "Bill Mitchell" <[EMAIL PROTECTED]> writes: > Sanjaya, you raise a question that I was going to ask Dinesh. In my > mind, I see Jira 675 as a bug. For some xml document trees, detach > generates a structure that is later unusable by the adb stubs that > depend on it. As such, it could stil

Re: Issue in using 'detach' for cloning

2008-02-21 Thread Dinesh Premalal
Hi, <[EMAIL PROTECTED]> writes: > Or, alternatively, of expanding axiom_node_free_tree to implicitly > detach the tree if it is attached before freeing it? (I prefer this > choice.) +1 thanks, Dinesh -- http://nethu.org - T

Re: Issue in using 'detach' for cloning

2008-02-21 Thread Dinesh Premalal
Hi Bill, "Bill Mitchell" <[EMAIL PROTECTED]> writes: > Samisa, it looks to me as if the branch Sanjaya created so far has > only my changes to AXIS2C-675. I think I misread this email the > first time to say that you had already written the changes to > implement a clone method. Were you intend

RE: Issue in using 'detach' for cloning

2008-02-21 Thread Bill Mitchell
performing an implied detach to make the free process more efficient. Regards, Bill -Original Message- From: Senaka Fernando [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 12:38 PM To: axis-c-dev@ws.apache.org Subject: RE: Issue in using 'detach' for cloning >

RE: Issue in using 'detach' for cloning

2008-02-21 Thread Bill Mitchell
7 and track the activity there. What do you think? Thanks, Bill -Original Message- From: Sanjaya Ratnaweera [mailto:[EMAIL PROTECTED] Sent: Monday, February 18, 2008 9:39 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Samisa Abeysinghe wr

RE: Issue in using 'detach' for cloning

2008-02-21 Thread Senaka Fernando
-Original Message- > From: Senaka Fernando [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 21, 2008 10:38 AM > To: Apache AXIS C Developers List > Subject: Re: Issue in using 'detach' for cloning > > Hi Bill, > > I believe you have replace the axiom_nod

RE: Issue in using 'detach' for cloning

2008-02-21 Thread Bill Mitchell
. Regards, Bill -Original Message- From: Senaka Fernando [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 10:38 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Hi Bill, I believe you have replace the axiom_node_detach logi

Re: Issue in using 'detach' for cloning

2008-02-21 Thread Senaka Fernando
>> From: Sanjaya Ratnaweera [mailto:[EMAIL PROTECTED] >> Sent: Thursday, February 21, 2008 8:22 AM >> To: Apache AXIS C Developers List >> Subject: Re: Issue in using 'detach' for cloning >> >> Hi bill, >> >>> I have created a branch fo

Re: Issue in using 'detach' for cloning

2008-02-21 Thread Sanjaya Ratnaweera
Developers List Subject: Re: Issue in using 'detach' for cloning Hi bill, I have created a branch for this. Here's the url. https://svn.apache.org/repos/asf/webservices/axis2/branches/c/axiomfix/ I have applied your patch in jira issue 675 to this branch. It failed in a

Re: Issue in using 'detach' for cloning

2008-02-21 Thread Samisa Abeysinghe
ion number. I will be seeking today to take my axiom_node_copy_tree routine and include it there. Thanks, Bill -Original Message- From: Sanjaya Ratnaweera [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 8:22 AM To: Apache AXIS C Developers List Subject: Re: Issue in usi

RE: Issue in using 'detach' for cloning

2008-02-21 Thread Bill Mitchell
--Original Message- From: Sanjaya Ratnaweera [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 8:22 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Hi bill, > I have created a branch for this. Here's the url. > > https://svn.apac

Re: Issue in using 'detach' for cloning

2008-02-21 Thread Sanjaya Ratnaweera
Hi bill, I have created a branch for this. Here's the url. https://svn.apache.org/repos/asf/webservices/axis2/branches/c/axiomfix/ I have applied your patch in jira issue 675 to this branch. It failed in a one file. (axiom/include/axiom_element.h). It had only api doc comment changes. The r

Re: Issue in using 'detach' for cloning

2008-02-18 Thread Sanjaya Ratnaweera
D] Sent: Saturday, February 16, 2008 10:33 PM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Kasun Indrasiri wrote: Hi all, I think, through out this thread there are various possible implementations were discussed with their pros and cons. I

Re: Issue in using 'detach' for cloning

2008-02-18 Thread Samisa Abeysinghe
[EMAIL PROTECTED] wrote: I noticed in working on changes to axiom_node_detach to ensure that the namespaces remain valid, that most of the uses of axiom_node_detach within Axis are followed immediately by an axiom_node_free_tree. It seems a shame to incur the overhead of re-declaring the namespac

RE: Issue in using 'detach' for cloning

2008-02-18 Thread bmitchell
I noticed in working on changes to axiom_node_detach to ensure that the namespaces remain valid, that most of the uses of axiom_node_detach within Axis are followed immediately by an axiom_node_free_tree. It seems a shame to incur the overhead of re-declaring the namespaces in the subtree being

Re: Issue in using 'detach' for cloning

2008-02-17 Thread Senaka Fernando
zing the structure >> I think uses builder interfaces that are not public and would need to be >> included, but does not involve an architecture change. Certainly a >> copy-on-write clone algorithm does involve some pervasive changes, but >> such an algorithm has other proble

Re: Issue in using 'detach' for cloning

2008-02-17 Thread Samisa Abeysinghe
[EMAIL PROTECTED] wrote: Yes, Samisa, I wrote a shallow copy that used the ref counted attributes, while creating new copies of element and text nodes as these are not ref-counted today. As I wrote it in the context of a C++ application, I need to do some cleanup to make it suitable to be include

RE: Issue in using 'detach' for cloning

2008-02-17 Thread bmitchell
ssage- From: Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Sent: Sunday, February 17, 2008 8:07 PM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Hi Bill, Kasun and others, Thank you all for taking time to explain this problem in detail. Looking at t

Re: Issue in using 'detach' for cloning

2008-02-17 Thread Samisa Abeysinghe
ed. Bill -Original Message- From: Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Sent: Saturday, February 16, 2008 10:33 PM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Kasun Indrasiri wrote: Hi all, I think, through out this thread the

Re: Issue in using 'detach' for cloning

2008-02-17 Thread Kasun Indrasiri
> > IMHO, cloning is not a use case that we really need for a SOAP engine. > If you are trying to use the same XML over and over again, passing it > here and there, without modification, you are really routing stuff and > not doing that many business logic processing. > I am still trying to figure

RE: Issue in using 'detach' for cloning

2008-02-17 Thread Senaka Fernando
s that are not public and would need to be included, but does not > involve an architecture change. Certainly a copy-on-write clone algorithm > does involve some pervasive changes, but such an algorithm has other > problems as well, already discussed. > > Bill > > -Origina

RE: Issue in using 'detach' for cloning

2008-02-17 Thread bmitchell
ne algorithm does involve some pervasive changes, but such an algorithm has other problems as well, already discussed. Bill -Original Message- From: Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Sent: Saturday, February 16, 2008 10:33 PM To: Apache AXIS C Developers List Subject: Re: Is

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Samisa Abeysinghe
Kasun Indrasiri wrote: Hi all, I think, through out this thread there are various possible implementations were discussed with their pros and cons. I agreed with Senaka that the clone method should not be the 'best' or 'fast' one. And also Bill's ref count based implementation would suit whe

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Samisa Abeysinghe
Supun Kamburugamuva wrote: I don't think I understand your comment about "it is the responsibility of the person who >declares the namespace to free it". Maybe this is a reference to some earlier discussion. >Perhaps this is related to something strange I see in the code today. The interface

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Supun Kamburugamuva
> I don't think I understand your comment about "it is the responsibility of > the person who >declares the namespace to free it". Maybe this is a > reference to some earlier discussion. >Perhaps this is related to something > strange I see in the code today. The interfaces to >axiom_element_

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Kasun Indrasiri
Hi all, I think, through out this thread there are various possible implementations were discussed with their pros and cons. I agreed with Senaka that the clone method should not be the 'best' or 'fast' one. And also Bill's ref count based implementation would suit where we may have to explicitly

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Dinesh Premalal
Samisa Abeysinghe <[EMAIL PROTECTED]> writes: > Given the chances of breaking the existing - shall we do this change > on a temporary branch, rather than on the svn head? +1 thanks, Dinesh -- http://nethu.org - To unsubscribe

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Senaka Fernando
Samisa, That is an ideal solution in testing this and getting our implementations straight, without ever having to worry about side effects. +1 Regards, Senaka > [EMAIL PROTECTED] wrote: >> Dinesh, you are right that one can develop a cloning algorithm that >> defers any copying until the object

RE: Issue in using 'detach' for cloning

2008-02-16 Thread Senaka Fernando
t; potential for a memory leak. Do you have any idea what the history is > behind these different behaviors? > > Thanks, > Bill > > -Original Message----- > From: Senaka Fernando [mailto:[EMAIL PROTECTED] > Sent: Friday, February 15, 2008 10:02 AM > To: Apache AXIS C Develo

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Samisa Abeysinghe
[EMAIL PROTECTED] wrote: Dinesh, you are right that one can develop a cloning algorithm that defers any copying until the object is modified, a copy-on-write algorithm. But such an algorithm would depend on knowing that ref counts are used only for cloning. Given this assumption, when the ref co

Re: Issue in using 'detach' for cloning

2008-02-16 Thread Samisa Abeysinghe
Supun Kamburugamuva wrote: Hi All, As far as I can see there is a problem with ref counts based cloning that is very hard to solve. Let's say we clone a node 5 times and we have six node trees. The cloned node trees will be pointing to the original node tree for some structures like namespaces.

RE: Issue in using 'detach' for cloning

2008-02-16 Thread bmitchell
hat the history is behind these different behaviors? Thanks, Bill -Original Message- From: Senaka Fernando [mailto:[EMAIL PROTECTED] Sent: Friday, February 15, 2008 10:02 AM To: Apache AXIS C Developers List Subject: RE: Issue in using 'detach' for cloning Hi, A locally via

RE: Issue in using 'detach' for cloning

2008-02-16 Thread bmitchell
malal Sent: Friday, February 15, 2008 2:44 AM To: axis-c-dev@ws.apache.org Subject: Re: Issue in using 'detach' for cloning Hi Bill, Samisa, Samisa Abeysinghe <[EMAIL PROTECTED]> writes: >> So I'm beginning to think there should be two functions, one is a >>

Re: Issue in using 'detach' for cloning

2008-02-15 Thread Supun Kamburugamuva
parent node, Node A, does not already refer to those same namespaces. > > > > I presume, as well, if he needs to include the detached subtree into > > several trees, a shallow copy works, as it preserves the information. > > > > Regards, > > Bill > >

RE: Issue in using 'detach' for cloning

2008-02-15 Thread Senaka Fernando
day, February 15, 2008 4:42 AM > To: Apache AXIS C Developers List > Subject: Re: Issue in using 'detach' for cloning > > Kasun Indrasiri wrote: >> >> >> On 2/15/08, *Samisa Abeysinghe* <[EMAIL PROTECTED] >> <mailto:[EMAIL PROTECTED]>&

Re: Issue in using 'detach' for cloning

2008-02-15 Thread bmitchell
- From: Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Sent: Friday, February 15, 2008 7:41 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning [EMAIL PROTECTED] wrote: > Samisa, I think what Kasun was saying is that detach, if it did not lose the > na

Re: Issue in using 'detach' for cloning

2008-02-15 Thread Samisa Abeysinghe
[EMAIL PROTECTED] wrote: Samisa, I think what Kasun was saying is that detach, if it did not lose the namespace references for the attributes, does work for him. When he attaches the detached tree into a new larger tree, the detached tree needs to keep valid namespace references for all of it

RE: Issue in using 'detach' for cloning

2008-02-15 Thread bmitchell
PROTECTED] Sent: Friday, February 15, 2008 4:42 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Kasun Indrasiri wrote: > > > On 2/15/08, *Samisa Abeysinghe* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > >

Re: Issue in using 'detach' for cloning

2008-02-15 Thread Samisa Abeysinghe
Kasun Indrasiri wrote: On 2/15/08, *Samisa Abeysinghe* <[EMAIL PROTECTED] > wrote: Once you detach, how are you going to use the detached node? Attach to another tree? Samisa... Hi, After detaching the node from the original node, the detached node

Re: Issue in using 'detach' for cloning

2008-02-15 Thread Kasun Indrasiri
On 2/15/08, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote: > > > Once you detach, how are you going to use the detached node? Attach to > another tree? > > > Samisa... > > Hi, After detaching the node from the original node, the detached node is attached to another node (say node A) as a child node.

Re: Issue in using 'detach' for cloning

2008-02-14 Thread Samisa Abeysinghe
Kasun Indrasiri wrote: Hi Bill, I have been following the discussions gone on this thread and do have few thoughts on the main issues that were discussed. First thing is the issue on axiom_node_detaching. As I mentioned earlier, the issue in detaching is simply because of keeping the refere

Re: Issue in using 'detach' for cloning

2008-02-14 Thread Dinesh Premalal
Hi Bill, Samisa, Samisa Abeysinghe <[EMAIL PROTECTED]> writes: >> So I'm beginning to think there should be two functions, one is a >> shallow copy of all the data elements and text values, sharing the >> attributes and namespaces, the second is a true clone of all the >> structures throughout

Re: Issue in using 'detach' for cloning

2008-02-14 Thread Kasun Indrasiri
Hi Bill, I have been following the discussions gone on this thread and do have few thoughts on the main issues that were discussed. First thing is the issue on axiom_node_detaching. As I mentioned earlier, the issue in detaching is simply because of keeping the reference of the namespace of the d

Re: Issue in using 'detach' for cloning

2008-02-14 Thread Samisa Abeysinghe
s through their ref counts. Regards, Bill -Original Message- From: Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 3:54 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning [EMAIL PROTECTED] wrote: ...

RE: Issue in using 'detach' for cloning

2008-02-14 Thread bmitchell
y the original? Regards, Bill -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 7:09 AM To: axis-c-dev@ws.apache.org Subject: RE: Issue in using 'detach' for cloning Good, Samisa, I did explain it clearly enough. The fact that an

RE: Issue in using 'detach' for cloning

2008-02-14 Thread bmitchell
ards, Bill -Original Message- From: Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 3:54 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning [EMAIL PROTECTED] wrote: > ... > > So for a clone algorithm t

Re: Issue in using 'detach' for cloning

2008-02-14 Thread Samisa Abeysinghe
[EMAIL PROTECTED] wrote: It should be, not trivial, but straightforward to write a clone algorithm for axiom nodes using the existing primitives. In particular, after creating a new node and data element like an original element, one should be able to attach the attributes using axiom_element_add

RE: Issue in using 'detach' for cloning

2008-02-13 Thread bmitchell
handling is a little trickier, as shown in the long message. Cheers, Bill From: Dinesh Premalal [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 12:48 AM To: Apache AXIS C Developers List Subject: Re: Issue in using 'detach' for cloning Hi Bill, On Feb 14, 2008 11:09 A

Re: Issue in using 'detach' for cloning

2008-02-13 Thread Dinesh Premalal
Hi Bill, On Feb 14, 2008 11:09 AM, <[EMAIL PROTECTED]> wrote: > Dinesh, I have the beginning of an axiom_node_clone method. But Kasun has > raised some issues that I did not have with attribute namespaces, and I > think my code needs revision, as well as some fixes in om_element.c. I didn't re

RE: Issue in using 'detach' for cloning

2008-02-13 Thread bmitchell
PROTECTED] On Behalf Of Dinesh Premalal Sent: Wednesday, February 13, 2008 1:27 AM To: axis-c-dev@ws.apache.org Subject: Re: Issue in using 'detach' for cloning Hi Kasun, "Kasun Indrasiri" <[EMAIL PROTECTED]> writes: > For e.g. If we try to axiom_node_to_string -&g

Re: Issue in using 'detach' for cloning

2008-02-12 Thread Samisa Abeysinghe
Dinesh Premalal wrote: Hi Kasun, "Kasun Indrasiri" <[EMAIL PROTECTED]> writes: For e.g. If we try to axiom_node_to_string -> it prints 'null' . But we can get any other attribute (local name or text) from the detached node. - And also for cloning nodes, we should have a better approach than

Re: Issue in using 'detach' for cloning

2008-02-12 Thread Senaka Fernando
Hi Kasun, and Dinesh, How about serializing the node and deserializing the node? This would not cause issues with especially having to clone namespaces etc. We could get the output string and then create an xml_reader and parse it and get the cloned copy. Thoughts? Regards, Senaka > Hi Kasun, >

Re: Issue in using 'detach' for cloning

2008-02-12 Thread Dinesh Premalal
Hi Kasun, "Kasun Indrasiri" <[EMAIL PROTECTED]> writes: > For e.g. If we try to axiom_node_to_string -> it prints 'null' . But we can > get any other attribute (local name or text) from the detached node. > > - And also for cloning nodes, we should have a better approach than 'detach'. > Because,