-
Notifications
You must be signed in to change notification settings - Fork 871
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
[Bug] Java Api .command(query) result in a temporary RID #8949
Comments
Hi @matanshukry did you begin a transaction before the command?
Thanks |
@wolf4ood Yup. Also doing .commit() after, but that's after I'm getting the recordid anyway. |
Hi @matanshukry this works for me
you should get the identity after the commit, since new records in tx have temporary rids Let me know if this helps Thanks |
@wolf4ood I am getting the identity before the .commit(), which seems to be issue. Although I'm using breakpoints, and although I'm getting a temporary identity at that point, if I'll query the database using another session/console, I can see the new row with a persistent identity. Hence it exist, so why can't I access it? Also, my current flow, which I believe is a common flow, is to convert the result of a db operation immediately when I have the result. Hence: where each method such as findUserBy/createUser would go something like this: |
@wolf4ood Actually, it seems it doesn't work after the .commit() either. What I tried after your comment: (1) session.begin() Line (7) is null. I can debug and see cluster position is still negative (-2). |
Hi @matanshukry that's strange. Do you have a test case to reproduce this? |
Oh i was testing using embedded and works fine. By switching to remote it remains negative Let me check |
cool thx. I tried checking by saving OResultSet instead of just OResult, and even calling |
yes because with begin and commit there is a server side transaction in progress. My understanding that at commit time there is no rebinding of final rids, which happens in embedded. |
@wolf4ood Yeah I realized that too now. Just to clarify though, when you're saying "my understanding" - are you referring to how things work, or how things should work? Also, I do notice According to |
Hi @matanshukry my understanding from a debug session is that the rebind is not working properly. |
Hi @matanshukry i was able to fix it. I'm running the test and if passes i will push it Thanks |
Hi @matanshukry i've just pushed a fix. it will be available in the next release 3.0.22 Thanks |
@wolf4ood awesome, cool! Since it's a client code It is a bit more difficult for me to get an updated code for it, so I'll have to wait. do you know when is 3.0.22 planned to be released? |
not yet sure when. Probably next week Thanks |
OrientDB Version: 3.0.21
Java Version: 1.8.0_211
OS: Windows 10
Expected behavior
The result of a create query will include a positive (real) RID
Actual behavior
The result of a create query includes a negative (temporary) RID
Steps to reproduce
The text was updated successfully, but these errors were encountered: