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

Database Corruption after delete in transaction #70

Open
ghost opened this issue Jun 18, 2015 · 2 comments
Open

Database Corruption after delete in transaction #70

ghost opened this issue Jun 18, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 18, 2015

Hello,

So far everything is perfect with OrientDB during testing, except one fact.
With .Net connector, current master branch, inside a transaction,
we have identified a scenario which corrupted the database.

First, this scenario is OK:

/* Create 2 vertices 1 and 2 */
var v1 = new OVertex { OClassName = "MY_ENTITY" };
v1.SetField("UUID", "Hello 1");
v1.SetField("Name", "First");

var v2 = new OVertex { OClassName = "MY_ENTITY" };
v2.SetField("UUID", "Hello 2");
v2.SetField("Name", "Second");

CRUDService.CurrentODB.Transaction.Add(v1);
CRUDService.CurrentODB.Transaction.Add(v2);

/* Create Edge between these vertices */
var e1 = new OEdge { OClassName = "MY_LINK" };
e1.SetField("UUID", "Hello 3");

CRUDService.CurrentODB.Transaction.Add(e1);

v1.SetField("in_MY_LINK", e1.ORID);
v2.SetField("out_MY_LINK", e1.ORID);
e1.SetField("in", v1.ORID);
e1.SetField("out", v2.ORID);

/* Commit transaction */
CRUDService.CurrentODB.Transaction.Commit();

But in this specific scenario, with a delete(vertex 1) command

var obj = GetVertex("Hello 1");
CRUDService.CurrentODB.Transaction.Delete(obj);
CRUDService.CurrentODB.Transaction.Commit();

At this step, Vertex 1 is deleted but not the Edge (so no cascading like without transaction?).
When we try to delete Edge with OrientDb Studio we have an NullPointException:

2015-06-18 11:07:44:666 SEVERE Internal server error:
java.lang.NullPointerException [ONetworkProtocolHttpDb]

We have to execute repair database:

orientdb {db=test_us_scenario}> repair database

Repairing database...
- Fixing dirty links...Done! Fixed links: 1, modified documents: 1
Repair database complete (0 errors)
orientdb {db=test_us_scenario}>

Is it due to a missing or specific command we have to use?

@csabakiss
Copy link

Hi YannVia,

We are having the same issue. Could you fixed this, or did you find a workaround?
Thanks!

@ghost
Copy link
Author

ghost commented Feb 16, 2016

Hi csabakiss,
Due to this issue we developped our own .net API to connect OrientDB in JSON with transaction.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant