-
Notifications
You must be signed in to change notification settings - Fork 697
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
SQLServer many to many relationship update breaks when updating from exposed 0.26.2 to 0.27.1 #1319
Comments
I wasn't able to reproduce it with the latest master. Can you please check the latest version and if your code will fail please share a sample project to debug. Thank you. |
Hello @Tapac Thanks a lot for your comment. At the moment I cannot strip down the application to create a minimal reproducible build, but I can tell you the following: For one of the many to many relations, namely role<->user I get this with version 0.27.1 to 0.33.1:
And this with version 0.26.1
The important difference is previously: while with the newer versions there is no OUTPUT Both versions use The relevant code: a simple UserTable, RoleTable, UserRoleTable:
I checked but Role.forIds(request.roles) does return a SizedIterable, so I am still not sure what's wrong... I mean, clearly the insert is wrong as it doesn't return anything, but it fails in that line. My question is: What do I need to change to that the insert generates an output/result set! like in the previous versions! Before I dive into producing a minimal example: Does that already help? |
From my point of view the error resides in: namely no idea how I can override this with the simple assignment syntax. Also note: Just removing roles is no problem at all. I can remove all the roles I want and everything works fine. But as soon as I want to assign a new role:
|
I found a problem, the fix will be released soon. |
… exposed 0.26.2 to 0.27.1 JetBrains#1319
Hello!
Running an sqlserver with exposed "0.26.2" I wanted to update to a newer version but ALL newer versions break on this code, at runtime:
Three tables, modeling a Many-to-Many relationship between A and B
in 0.26.2 this works fine. From 0.27.1 onwards I get a runtime exception "Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set."
I read the release notes of 0.27.1:
As the code breaks with this version, I assume it is related, but I am not sure and I am also not sure how I can set
shouldReturnGeneratedValues=true
when I just use the assignment syntax like above (toUpdate.bs = SizedCollection(newBs)
) I couldn't find an issue and the documentation https://github.com/JetBrains/Exposed/wiki/DAO#many-to-many-reference is still the same.Any input how to fix this in a later version would be highly appreciated. I don't want to be stuck with 0.26.2 forever but as it stands, I can't upgrade without doing a git bisect and diving deep into the codebase of a dependency I'd rather not touch myself.
Thanks for any insights and potential solutions you share beforehand!
The text was updated successfully, but these errors were encountered: