-
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
Orient 3.0 - No automatic rollbacks when exception happens #7451
Comments
Hi @careerscale do you have a test case for this? |
looks like only OValidationException is resulting in proper rollbacks. other scenarios are not working. there are 2 test cases, one for positiive (working) and other for negative. |
Hi @careerscale the graph.close() currently commit the current tx if any. In your second test case the first addVertex is ok so when the graph is close that vertex is committed. The missing part is this way of configuring the TX using TP3 api. See here http://tinkerpop.apache.org/docs/current/reference/#transactions |
@maggiolo00 , I am not sure if I got it. I modified the code a bit to use factory.getTx() but that didnt make any difference. Essentially when IllegalStateException happens, I do not see rollback happening.
|
hi @careerscale rollback aren't automatic. |
@maggiolo00, I think as per my previous conversations, I was told we dont need to add rollback explicitly. Actually we made the change in our project code but that results me at times, "No Transaction Active" exception randomly. |
and when we hit this "No Transaction Active" exception, we will not be able to get out of it, we needed to restart DB. |
Hi @careerscale with manual rollback you got Once the TP3 lifecycle is implemented correctly you can configure that on close the tx is rollbacked |
@maggiolo00 This is what we are doing.
Am I missing any step? |
hi @careerscale i mean in the implementation of Tinkerpop3 of OrientDB.
|
Btw i've implemented the new ResultSet for working directly with OrientVertex/OrientEdge please tell me if you encounter issues orientechnologies/orientdb-gremlin#130 Thanks |
@maggiolo00 , yes that broke our code, so modifying it with OGremlinResultSet now. this will be the one that will remain right? |
@maggiolo00, |
hi @careerscale for transaction configuration i've raised an issue here orientechnologies/orientdb-gremlin#131 for Since Thanks |
@maggiolo00 , Looks like DB is really unstable |
@maggiolo00 #7470 can you pleaes check this one? |
i'm checking it |
@maggiolo00 Thank you. Please let me know if you need any inputs |
hi @careerscale, This should be already fixed in the last 3.0.0-SNAPSHOT, can we close this ? Regards |
@tglman , do we need rollback stmt manually or is it automatic (if no commit no data gets committed?). |
we are using rollback everytime now, based on your confirmation, will remove rollback stmt |
hi @careerscale, Yes using TP3 API is correct to add a with TP3 as today we have automatic commit on close Regards |
oh ok, so there is automatic commit but rollback is mandatory. got it. does it hurt if we have commit stmt too? Also if there are no data manipulations but only reads, does this rolllback hurt? |
hi @careerscale, If the transaction is already committed the close does nothing, so a commit in the code doesn't hurt. Hope it helps. Regards |
yes, that is good for me. thank you. |
@tglman , Based on earlier conversations, we wrote a comit method that loops through in case of failures and retries it (if applicable). we wrote this in a base class and using it across. Do you suggest to retain this or remove it now? assuming this is done as part of the commit process (so the client api takes care of it automatically and application doesnt need to do it?).
|
hi @careerscale, The retry should be done on the whole transaction not just on the commit, so you can do retrying but this need to be wrapped around the whole tx operations. |
I am using Tinkerpop API If the commit fails for the first time due to out of date vertices in the graph, graph.tx().commit is not succeeding again on retry. |
OrientDB Version: 3.0
Java Version: 1.8
OS: Win 7
Expected behavior
We are using gremlin api (TP 3.0) and everything working fine with 3.0 with latest snapshots.
one issue we see is that we need to add rollback as a manual step, but as per my understanding,
graph.rollback() is not required (also we removed the graph.begin() as it seemed implicit)
Actual behavior
partial data is getting saved without proper rollback.
Steps to reproduce
Unit test to follow
The text was updated successfully, but these errors were encountered: