Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://code.google.com/archive/p/beanio/issues/131 #10

Open
johnpoth opened this issue May 20, 2016 · 2 comments
Open

https://code.google.com/archive/p/beanio/issues/131 #10

johnpoth opened this issue May 20, 2016 · 2 comments

Comments

@johnpoth
Copy link

hat steps will reproduce the problem? 1. Create multiple Unmarshallers (one per thread) from the same StreamFactory 2. Unmarshall records with a date in each of the threads

What is the expected output? What do you see instead? All records get unmarshalled correctely. Instead, Exceptions get thrown.

What version of BeanIO are you using? What JDK version? BeanIO 2.1.0

Please provide any additional information below. While the documentation claims that "All included BeanIO type handlers are thread safe", DateTypeHandlerSupport potentially uses the same SimpleDateFormat for multiple Unmarshaller instances. Since SimpleDateFormat is not thread-safe this causes the behaviour as shown. Switching to a custom TypeHandler that uses a thread-local SimpleDateFormat solves the problem.

Comment #1

Posted on Apr 27, 2015 by Helpful Camel
Same behaviour when using beanIO in a camel route.

Strange exceptions that trace back to SimpleDateFormat not being thread safe.

@nicoschl
Copy link
Collaborator

Hi @johnpoth

Would it be possible to add a test case for your proposed change?

Thanks
Nico

@bjansen
Copy link

bjansen commented Mar 13, 2021

Fixed in https://github.com/beanio/beanio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants