You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Ludger Bünger (JIRA)" <xe...@xml.apache.org> on 2008/12/04 18:16:46 UTC
[jira] Created: (XERCESJ-1345) Listener Count datastructure in
DocumentImpl should be a document variable and not static.
Listener Count datastructure in DocumentImpl should be a document variable and not static.
------------------------------------------------------------------------------------------
Key: XERCESJ-1345
URL: https://issues.apache.org/jira/browse/XERCESJ-1345
Project: Xerces2-J
Issue Type: Improvement
Reporter: Ludger Bünger
The listener count datastructure is currently a static global hashtable.
This has the disadvantage of not being thread-safe even across otherwise totally independent document instances since each uses the same static hashtable to keep track of the number of event listeners registered upon the document.
A second effect of this is:
Deserializing a document with listeners registered upon it in a freshly created virtual machine (with a fresh static listener table having no listener count data inside) causes the document to believe no event listeners are registered upon it and thus not causing dom events to be fired even though listeners are registered.
Thus serialisation/deserialisation of documents having listeners registered upon them is factually broken since the very first implementation of event listeners using the static listener counters (which is if I did not get it wrong since event listeners have been implemented in xerces).
--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Assigned: (XERCESJ-1345) Listener Count datastructure in
DocumentImpl should be a document variable and not static.
Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESJ-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Glavassevich reassigned XERCESJ-1345:
---------------------------------------------
Assignee: Michael Glavassevich
> Listener Count datastructure in DocumentImpl should be a document variable and not static.
> ------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1345
> URL: https://issues.apache.org/jira/browse/XERCESJ-1345
> Project: Xerces2-J
> Issue Type: Improvement
> Components: DOM (Level 2 Events)
> Affects Versions: 2.9.1
> Reporter: Ludger Bünger
> Assignee: Michael Glavassevich
> Attachments: Xerces-Eventlistener-Count-patch.txt
>
>
> The listener count datastructure is currently a static global hashtable.
> This has the disadvantage of not being thread-safe even across otherwise totally independent document instances since each uses the same static hashtable to keep track of the number of event listeners registered upon the document.
> A second effect of this is:
> Deserializing a document with listeners registered upon it in a freshly created virtual machine (with a fresh static listener table having no listener count data inside) causes the document to believe no event listeners are registered upon it and thus not causing dom events to be fired even though listeners are registered.
> Thus serialisation/deserialisation of documents having listeners registered upon them is factually broken since the very first implementation of event listeners using the static listener counters (which is if I did not get it wrong since event listeners have been implemented in xerces).
--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Updated: (XERCESJ-1345) Listener Count datastructure in
DocumentImpl should be a document variable and not static.
Posted by "Ludger Bünger (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESJ-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ludger Bünger updated XERCESJ-1345:
-----------------------------------
Issue Type: Bug (was: Improvement)
Since this issue causes threading issues I think it should be treated as a bug.
> Listener Count datastructure in DocumentImpl should be a document variable and not static.
> ------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1345
> URL: https://issues.apache.org/jira/browse/XERCESJ-1345
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 2 Events)
> Affects Versions: 2.9.1
> Reporter: Ludger Bünger
> Assignee: Michael Glavassevich
> Attachments: Xerces-Eventlistener-Count-patch.txt
>
>
> The listener count datastructure is currently a static global hashtable.
> This has the disadvantage of not being thread-safe even across otherwise totally independent document instances since each uses the same static hashtable to keep track of the number of event listeners registered upon the document.
> A second effect of this is:
> Deserializing a document with listeners registered upon it in a freshly created virtual machine (with a fresh static listener table having no listener count data inside) causes the document to believe no event listeners are registered upon it and thus not causing dom events to be fired even though listeners are registered.
> Thus serialisation/deserialisation of documents having listeners registered upon them is factually broken since the very first implementation of event listeners using the static listener counters (which is if I did not get it wrong since event listeners have been implemented in xerces).
--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Updated: (XERCESJ-1345) Listener Count datastructure in
DocumentImpl should be a document variable and not static.
Posted by "Ludger Bünger (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESJ-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ludger Bünger updated XERCESJ-1345:
-----------------------------------
Attachment: Xerces-Eventlistener-Count-patch2.txt
Since the Xerces repository evolved since I provided the patch, the first patch does not merge anymore without conflicts.
So I herewith provide an updated functionally equivalent patch solving the merge conflicts of the older patch.
It would be nice if this issue could be solved soon.
> Listener Count datastructure in DocumentImpl should be a document variable and not static.
> ------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1345
> URL: https://issues.apache.org/jira/browse/XERCESJ-1345
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 2 Events)
> Affects Versions: 2.9.1
> Reporter: Ludger Bünger
> Assignee: Michael Glavassevich
> Attachments: Xerces-Eventlistener-Count-patch.txt, Xerces-Eventlistener-Count-patch2.txt
>
>
> The listener count datastructure is currently a static global hashtable.
> This has the disadvantage of not being thread-safe even across otherwise totally independent document instances since each uses the same static hashtable to keep track of the number of event listeners registered upon the document.
> A second effect of this is:
> Deserializing a document with listeners registered upon it in a freshly created virtual machine (with a fresh static listener table having no listener count data inside) causes the document to believe no event listeners are registered upon it and thus not causing dom events to be fired even though listeners are registered.
> Thus serialisation/deserialisation of documents having listeners registered upon them is factually broken since the very first implementation of event listeners using the static listener counters (which is if I did not get it wrong since event listeners have been implemented in xerces).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Updated: (XERCESJ-1345) Listener Count datastructure in
DocumentImpl should be a document variable and not static.
Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESJ-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Glavassevich updated XERCESJ-1345:
------------------------------------------
Component/s: DOM (Level 2 Events)
Affects Version/s: 2.9.1
> Listener Count datastructure in DocumentImpl should be a document variable and not static.
> ------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1345
> URL: https://issues.apache.org/jira/browse/XERCESJ-1345
> Project: Xerces2-J
> Issue Type: Improvement
> Components: DOM (Level 2 Events)
> Affects Versions: 2.9.1
> Reporter: Ludger Bünger
> Attachments: Xerces-Eventlistener-Count-patch.txt
>
>
> The listener count datastructure is currently a static global hashtable.
> This has the disadvantage of not being thread-safe even across otherwise totally independent document instances since each uses the same static hashtable to keep track of the number of event listeners registered upon the document.
> A second effect of this is:
> Deserializing a document with listeners registered upon it in a freshly created virtual machine (with a fresh static listener table having no listener count data inside) causes the document to believe no event listeners are registered upon it and thus not causing dom events to be fired even though listeners are registered.
> Thus serialisation/deserialisation of documents having listeners registered upon them is factually broken since the very first implementation of event listeners using the static listener counters (which is if I did not get it wrong since event listeners have been implemented in xerces).
--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Updated: (XERCESJ-1345) Listener Count datastructure in
DocumentImpl should be a document variable and not static.
Posted by "Ludger Bünger (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESJ-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ludger Bünger updated XERCESJ-1345:
-----------------------------------
Attachment: Xerces-Eventlistener-Count-patch.txt
This patch moves the static listener count inside the document instance, i.e. that each document uses it's own listener counters.
Besides fixing the mentioned issues this also has the side effect of speeding up dom mutations for documents having no event listeners registered if other documents are (somewhere) present in the same VM having dom event listeners.
Furthermore since listener deserialisation caused unpredictable behavior I declared the listener datastructures as transient.
I am not sure whether the community considers this is a good idea, however this has not been working before anyhow.
> Listener Count datastructure in DocumentImpl should be a document variable and not static.
> ------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1345
> URL: https://issues.apache.org/jira/browse/XERCESJ-1345
> Project: Xerces2-J
> Issue Type: Improvement
> Reporter: Ludger Bünger
> Attachments: Xerces-Eventlistener-Count-patch.txt
>
>
> The listener count datastructure is currently a static global hashtable.
> This has the disadvantage of not being thread-safe even across otherwise totally independent document instances since each uses the same static hashtable to keep track of the number of event listeners registered upon the document.
> A second effect of this is:
> Deserializing a document with listeners registered upon it in a freshly created virtual machine (with a fresh static listener table having no listener count data inside) causes the document to believe no event listeners are registered upon it and thus not causing dom events to be fired even though listeners are registered.
> Thus serialisation/deserialisation of documents having listeners registered upon them is factually broken since the very first implementation of event listeners using the static listener counters (which is if I did not get it wrong since event listeners have been implemented in xerces).
--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org