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
Multiupdate query in mybaties mapper #1497
Comments
You have to allow multi queries in your driver.
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html |
It worked, thank you so much @h3adache |
I got following result of comparing multiquery (foreach loop used for making multiple query in mapper xml) with batchquery (query run in ExecutorType.BATCH typed SqlSession) [foreach in my javaclass to make multiple query and add those query in batch and commit at last]:
My question is: why above two type of execution is so different? Does multiquery (adding multiple query in mapper xml) assure us the Atomicity like batchquery or transaction query does [revert all query if one of them is failed]? Thanks in advance! |
now it is https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html |
Hello,
I am trying to execute multiple update mysql query statements build in mybatis mapper xml file:
MyMapper.xml :
In MyRepositoryImpl.java:
this.sqlSession.update(RepositoryConstants.getFullMapperMethodId(BatchQueryTestRepository.class, "update_list"), ids);
After while running above statement I got an following error:
I am using mysql as database. I can execute multiple update query using DataGrip (mysql client).
I am executing multiple query this way to compare it with query run by using ExecutorType.BATCH type SqlSession.
Could you please help to resolve above exception? Let me know if you need any further information regarding this.
Thank you!
Sunil
The text was updated successfully, but these errors were encountered: