-
Notifications
You must be signed in to change notification settings - Fork 869
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
Transaction issue #1745
Comments
I just realized that I never called save() on the newly created vertex in the test app. When I looked at the OCommandExecutorSQLCreateVertex class the execute() calls save() on the vertex. So I thought it might have something to do with the save() and removed all calls to save() from our large scale application. And now everything seems to work. When I call commit() the vertices/edges are inserted in the database and when I call rollback() nothing is inserted, just like one would expect. So for me it seems calling save() is unnecessary anyway. Is this correct? Can you tell me when I have to call save()? After that I tried again with the test app and added a call to save() right after addVertex(), but the issue still won't occur in small scale. :( |
What API are you using? The old native Graph API? Use TinkerPop ;-) |
I use tinkerpop API as you can see in the sample java code. Maybe my confusion comes from the fact that the Blueprint OrientElement has a method called save(). I always thougth I had to call OrientElement.save() to actually save the element. But on a transactional graph the save() somehow already commits the transaction, so calling rollback() won't work. When I remove the save() call rollback() works fine. And calling commit() actually stores the element, even without ever calling element.save(). So I better not call save() at all? And again try running this little sql script with your console application (which uses the new tinkerpop API and also calls save() for create vertex), once with remote and once with local connection, and you'll see different results. For local connection create vertex returns a temporary vertex (rid is #9:-2) and the select returns 0 results whereas for remote connections create vertex already stores the vertex (rid is #9:0) and select returns 1 result (#9:0) even after rollback. begin |
Hi look at Isolation when use "remote": https://github.com/orientechnologies/orientdb/wiki/Transactions#isolation About save() it's non BP but internal. It's useful when you act at document level to speed up setting of properties. |
Ok, but Isolation doesnt explain why the data is not rolled back, does it? I didn't mean to execute the sql at the same time with 2 transactions doing different stuff. Just execute the sql for "remote", nothing else. From my experience with other DBMS I thought that begin; insert into table...; rollback; will leave an empty table (assuming it was empty before) which apperantly isn't the case when using OrientDB console with "remote" |
the transaction is executed on client side, while all the SQL command at the server side. That's why. By using the console this has poor sense, but with Java apps more. We've an open issue to let to OrientDB to start the tx on the server side (like RDBMS). |
We have encountered some strange transaction issues inside or application when using remote connections. For some reason I can only reproduce this with the console application.
OrientDB version I am using: v.1.6.0-SNAPSHOT 20131010-1330
When using local connections the results are as expected:
After that I wrote a small Java app to reproduce the problem, but for some strange reason everything works fine in this small scale app.
The text was updated successfully, but these errors were encountered: