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

Exception removing multiple elements from ordered embeddable collection #602

Closed
blafond opened this issue Feb 22, 2021 · 7 comments · Fixed by #604
Closed

Exception removing multiple elements from ordered embeddable collection #602

blafond opened this issue Feb 22, 2021 · 7 comments · Fixed by #604
Assignees
Labels
bug Something isn't working
Milestone

Comments

@blafond
Copy link
Member

blafond commented Feb 22, 2021

running additional tests to check latest Reactive collection persister logic from the @OrderColumn #581 changes. Ran into an issue removing more than 1 element during a flush().

See: OrderedEmbeddableCollectionTest

Exception: [Exception 0] io.vertx.core.impl.NoStackTraceThrowable: The number of parameters to execute should be consistent with the expected number of parameters = [2] but the actual number is [3].
[Exception 1] io.vertx.core.VertxException: Transaction already completed

Appears that the Object[] array of param values is returning an Object[3] instead of Object[2] for the second deleted element in the new abstract persister:

@gavinking gavinking added the bug Something isn't working label Feb 22, 2021
@gavinking gavinking added this to the 1.0 CR milestone Feb 22, 2021
@gavinking
Copy link
Member

Might be worth getting the test working on Hibernate ORM core, just to be able to step through and see what happens there.

@blafond
Copy link
Member Author

blafond commented Feb 22, 2021

In ORM's deleteRows the int offset = 1; never changes.

In Reactive, we're passing the offset into the deleteRowsParamValues( entry, index+1, id, session ) call, which is based on an incremented index value. Seems we're wrongly combining the concepts of i, index, loc and offset in ORM.

The i value appears to provide update and insert methods to know which collection entry is being operated on, so it shouldn't be tied to/used in the delete process.

@gavinking
Copy link
Member

Yup, it looks like the logic is just wrongly-ported-over.

@blafond
Copy link
Member Author

blafond commented Feb 22, 2021

I think just changing the index+1" to 1 reflects the ORM logic

@gavinking
Copy link
Member

Great!

@DavideD
Copy link
Member

DavideD commented Feb 23, 2021

Good catch!

@blafond: I've assigned this to you as it seems you have already a fix

@gavinking
Copy link
Member

Thanks, @blafond

DavideD pushed a commit to DavideD/hibernate-reactive that referenced this issue Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants