You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "David Poon (JIRA)" <ji...@apache.org> on 2008/01/14 00:28:33 UTC

[jira] Reopened: (AXIS2-3400) AxisService name not unique enough

     [ https://issues.apache.org/jira/browse/AXIS2-3400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Poon reopened AXIS2-3400:
-------------------------------


We applied the revision 606114 to InterfaceImplementationTemplate.xsl and inserted the revised xsl into axis2-codegen-1.3.jar and axis2-1.3.jar. We regenerated our stubs with the revised jars; and repeated our performance and stress tests.

The change made by revision 606114 actually made the problem *worse* - we encountered more occurrences of the "duplicate name error". To recheck, we reverted the change (ie gone back to Object.hashCode) and ran the tests again, the occurrences of the error reduced considerably (the error of course, still occurs).

The this issue is actually not fixed.

When I originally mentioned the use of a counter by way of an example, I meant using Object.hashCode concatenated with a counter; not removing the use of Object.hashCode altogether as what revision 606114 has done.

> AxisService name not unique enough
> ----------------------------------
>
>                 Key: AXIS2-3400
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3400
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.3
>            Reporter: David Poon
>            Priority: Blocker
>
> The generated (client) stub implementation's populateAxisService() method creates the AxisService name using Object.hashCode() as a means to "ensure" uniqueness, for example:
> //creating the Service with a unique name
> _service = new org.apache.axis2.description.AxisService("IsisLocation" + this.hashCode());
> In our performance and stress test runs, we find that from time to time, "duplicate name found" errors would occur. We reuse the same configuration context instance over multiple client service invocations. The javadoc of java.lang.Object.hashCode() states that:
> "... It is not required that if two objects are unequal according to the java.lang.Object.equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. ... As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)"
> In essence uniqueness is not guaranteed.
> Even though the Stub's finalize() method calls its own cleanup() method (which would remove the AxisService name), it is still possible for a duplicate name being generated whilst the other Stub is still in use (by another thread).
> Perhaps in addition to using hashCode(), a static incrementing counter could be appended to the generated name as well?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org