Skip to content

Castor is not thread safe. #59

@Dinesh-Khandelwal

Description

@Dinesh-Khandelwal

We are using castor-xml-1.3.2.jar for Xml data binding. In production we had an issue where the amount field which is of type BigDecimal, was getting swapped with other amount value from different xml document and thread at the time of un-marshalling. When we analyzed further we found the issue with PrimitiveObjectFactory class which internally has static Map of handlers to handle different data types. This handler is used to create the respective data type objects with the values passed from SAX parser. But the handler maintains a state with fields Class<?> type; String value; Object object; in PrimitiveObject class which is super class of all the handlers and which is not thread safe.

Earlier we thought that the issue is only for Big-Decimal but its is for any other data type as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions