Open cjpraful opened 7 years ago
hi @cjpraful
do you have a script to reproduce it?
How do you create edges?
Hi @cjpraful
do you have any news on how to reproduce this?
Thanks
@maggiolo00 sorry for the delayed response. Please find the final orientjs transaction query details below
LET newProject = (CREATE vertex sml_Project SET name = "DemoProject1", description = "This is a DemoProject"),
firstEdge = (CREATE EDGE edge1 FROM $newProject TO #45:0),
secondEdge = (CREATE EDGE edge2 FROM $newProject TO #45:0)
As mentioned in the issue, after the successful execution of above transaction operation , in_edge2 property is showing wrong/corrupt value
{"@type": "d","@version": 0,"@class": "edge2","out": "#94:58","in": "#45:0","@fieldTypes": "out=x,in=x"}
hi @cjpraful
After the tx do you execute the query in studio or with orientjs?
Thanks
I am executing query via orientjs.
hi @cjpraful
i created a new database and execute this sql in order to create the classes
create class Project extends V
create class USer extends V
insert into user set name = 'Foo'
then i ran this script User#25:0
var ODatabase = require('orientjs').ODatabase;
var db = new ODatabase({
host: 'localhost',
port: 2424,
username : 'admin',
password : 'admin',
name : 'bug'});
db.open().then(function(){
var query = `LET newProject= CREATE vertex Project SET name = "DemoProject1", description = "This is a DemoProject"
let firstEdge = CREATE EDGE edge1 FROM $newProject TO #25:0
let secondEdge = CREATE EDGE edge2 FROM $newProject TO #25:0
return $newProject`
db.query(query,{"class": "s"}).then(function(res){
db.query(`select in_edge2 from #25:0`).then(function(res){
console.log(JSON.stringify(res));
});
});
})
i did not experience this problem.
How can i replicate it ?
Thanks
We are using OrientJS transaction mechanism in our coding to create vertex and edge. Currently facing an issue while creating edges. Sometimes, when we create edge e1 of sampleEdge from V1 to V2 edge rid (in_sampleEdge on V2) is loaded as document:{@type:document,@version:0,out:#12:3,in:#45:6}
If we query on sampleEdge then e1 appears to be #78:9
If we query on V1 then e1 appears to be out_sampleEdge = #78:9
If we query on e1 of sampleEdge (i.e. #78:9) output is {@type:document,@version:1,out:#12:3,in:#45:6}.
Please note the versions. Actual version is 1 but on V2's IN property it appears as document with version 0.
Please find the Query results. Here I am creating User verted, Project Vertex and creating edge ownedByUser.
select * from #278:56 (Query on Edge) {"@type":"d","@rid":"#278:56","@version":1,"@class":"ownedByUser","out":"#96:54","in":"#45:34","@fieldTypes":"out=x,in=x"}
select out_ownedByUser from #96:54 (Query on Project) {"@type":"d","@rid":"#-2:0","@version":0,"out_ownedByUser":["#278:56"],"@fieldTypes":"out_ownedByUser=g"}
select in_ownedByUser from #45:34 (Query of User) {"@type":"d","@rid":"#-2:0","@version":0,"in_ownedByUser":[{"@type":"d","@version":0,"@class":"ownedByUser","out":"#96:54","in":"#45:34","@fieldTypes":"out=x,in=x"}]}
This looks like a major bug in OrientDb for me. Edge is created, out property of originating vertex is finely updated. But not the destination vertex. Its in_edge property is stored as document rather @rid. I believe its because @rid is not available in its metadata.
Kindly help on this.