-
Notifications
You must be signed in to change notification settings - Fork 36
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
Thread-safe problem while inserting(java.sql.SQLException: SQL String cannot be NULL ) #80
Comments
gamtruliar
changed the title
Thread-safe problem while inserting
Thread-safe problem while inserting(java.sql.SQLException: SQL String cannot be NULL )
Nov 10, 2022
Yup, I can see how this can happen. I just added a "synchronized" keyword to the method and pushed it to master. Version bumped to 1.0.6. Can you test it to see if it fixes the problem? |
@gamtruliar Did the change fix your problem? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
java.sql.SQLException: SQL String cannot be NULL
In StandardSqlMaker getPojoInfo:
private static ConcurrentHashMap<Class<?>, StandardPojoInfo> map = new ConcurrentHashMap<>();
There is some case that sql is not generated before using,
when doing many inserts in many threads at the first time.
When B thread get a StandardPojoInfo just after A thread finished the row of "map.put(rowClass, pi);"
B will get a StandardPojoInfo with null sql and then cause a exception.
It seem to need a lock for it. :)
The text was updated successfully, but these errors were encountered: