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 Mukul Gandhi <mu...@apache.org> on 2011/10/01 06:41:36 UTC

Re: [jira] [Commented] (XERCESJ-1538) Multithread validation failed in Xerces2 with XML Schema 1.1 support when assert instruction in XSD

Hi Den,
    Thanks for sharing the application logic.

Would be nice if you can post future comments/attachments for a
issue/bug been raised on the jira system itself, as Michael pointed to
keep a issue thread tied in one place.

I've few comments to your mail below.

On Thu, Sep 29, 2011 at 10:45 PM, Den Orekhoff <or...@gmail.com> wrote:
> src\props_wrong.xml - it is wrong data for assertion.
> Your assertion expresion don't handle it because not check
> main_context element position.

It seems I misunderstood the requirement and wrote a wrong XPath
expression. The right version that I must have written would be,

if (datapanel or server) then main_context[not(preceding-sibling::*)]
else true()

(you wrote that, element 'main_context' must be first child of element
'action'; this means for me that element "main_context" should not
have an preceding-sibling elements, and that's what the modified
assertion above is achieving -- and this works for me with latest code
base from SVN)

Therefore I can run fine, with your use case in single thread
scenario. Your java application example, is pretty involved and would
require detailed investigation, to conclude if your observation is a
bug with Xerces.

I think, compliance of a XSD processor to the XSD language, doesn't
require threading issues to be considered, and achieving specific
validation objectives (like validation in multhithreading context)
must have an external design from the application and/or schema
authors. With this thought, I think Xerces may not have a bug, for the
use case that you've shared with us.




-- 
Regards,
Mukul Gandhi

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


Re: [jira] [Commented] (XERCESJ-1538) Multithread validation failed in Xerces2 with XML Schema 1.1 support when assert instruction in XSD

Posted by Mukul Gandhi <mu...@apache.org>.
Hi Michael,
    Thanks for analyzing the causes of problems, mentioned in this bug report.

We would definitely try to fix the problem, if present in code base.

On Sat, Oct 1, 2011 at 9:32 PM, Michael Glavassevich
<mr...@ca.ibm.com> wrote:
> Mukul,
>
> A javax.xml.validation.Schema [1] is required to be thread-safe. Xerces has
> a bug if it doesn't satisfy that.
>
> Den mentioned that this problem occurs even when SchemaFactory and Schema
> objects are not shared between threads. That sounds very much like there's a
> statically mutable field somewhere within Xerces or Psychopath that is
> causing this issue. If multiple threads can't validate assertions
> simultaneously we need to fix that.
>
> Thanks.
>
> [1]
> http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/Schema.html
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org





-- 
Regards,
Mukul Gandhi

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


Re: [jira] [Commented] (XERCESJ-1538) Multithread validation failed in Xerces2 with XML Schema 1.1 support when assert instruction in XSD

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Mukul,

A javax.xml.validation.Schema [1] is required to be thread-safe. Xerces has
a bug if it doesn't satisfy that.

Den mentioned that this problem occurs even when SchemaFactory and Schema
objects are not shared between threads. That sounds very much like there's
a statically mutable field somewhere within Xerces or Psychopath that is
causing this issue. If multiple threads can't validate assertions
simultaneously we need to fix that.

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/Schema.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Mukul Gandhi <mu...@apache.org> wrote on 10/01/2011 12:41:36 AM:

> Hi Den,
>     Thanks for sharing the application logic.
>
> Would be nice if you can post future comments/attachments for a
> issue/bug been raised on the jira system itself, as Michael pointed to
> keep a issue thread tied in one place.
>
> I've few comments to your mail below.
>
> On Thu, Sep 29, 2011 at 10:45 PM, Den Orekhoff <or...@gmail.com>
wrote:
> > src\props_wrong.xml - it is wrong data for assertion.
> > Your assertion expresion don't handle it because not check
> > main_context element position.
>
> It seems I misunderstood the requirement and wrote a wrong XPath
> expression. The right version that I must have written would be,
>
> if (datapanel or server) then main_context[not(preceding-sibling::*)]
> else true()
>
> (you wrote that, element 'main_context' must be first child of element
> 'action'; this means for me that element "main_context" should not
> have an preceding-sibling elements, and that's what the modified
> assertion above is achieving -- and this works for me with latest code
> base from SVN)
>
> Therefore I can run fine, with your use case in single thread
> scenario. Your java application example, is pretty involved and would
> require detailed investigation, to conclude if your observation is a
> bug with Xerces.
>
> I think, compliance of a XSD processor to the XSD language, doesn't
> require threading issues to be considered, and achieving specific
> validation objectives (like validation in multhithreading context)
> must have an external design from the application and/or schema
> authors. With this thought, I think Xerces may not have a bug, for the
> use case that you've shared with us.
>
>
>
>
> --
> Regards,
> Mukul Gandhi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org