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

Cannot create edge with new vertices in the same transaction #7534

Closed
crossknight opened this issue Jul 7, 2017 · 17 comments
Closed

Cannot create edge with new vertices in the same transaction #7534

crossknight opened this issue Jul 7, 2017 · 17 comments
Assignees
Labels
Milestone

Comments

@crossknight
Copy link

crossknight commented Jul 7, 2017

OrientDB Version: 2.2.5 - 2.2.22

Java Version: 8 update 131

OS: macOS, FreeBSD

Expected behavior

Commit with these commands successfully via binary protocol (version 2.2.4)
BEGIN;
CREATE VERTEX V SET num = 13
CREATE VERTEX V SET num = 14
CREATE EDGE E FROM (SELECT FROM V WHERE num = 13) TO (SELECT FROM V WHERE num = 14)
COMMIT;

Actual behavior

Commit failed
com.orientechnologies.orient.core.exception.OCommandExecutionException: No edge has been created because no source vertices

Steps to reproduce

Send commands
BEGIN;
CREATE VERTEX V SET num = 13
CREATE VERTEX V SET num = 14
CREATE EDGE E FROM (SELECT FROM V WHERE num = 13) TO (SELECT FROM V WHERE num = 14)
COMMIT;
via binary protocol (request command script "s", script language "SQL")

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

hi @crossknight

do you have a script to reproduce it?

I just tried to run that batch script with orientjs against 2.2.22 and it worked.

Thanks

@wolf4ood wolf4ood self-assigned this Jul 7, 2017
@crossknight
Copy link
Author

crossknight commented Jul 7, 2017

Umm,, Sorry, It's a test case from my unit test so I don't have a script to reproduce it.
I sent a message as binary via socket like this

Message (Show as string for easily read)
4194s1771s3SQLBEGIN;\nCREATE VERTEX V SET num = 13\nCREATE VERTEX V SET num = 14\nCREATE EDGE E FROM (SELECT FROM V WHERE num = 13) TO (SELECT FROM V WHERE num = 14)\nCOMMIT;

Message description
41 - ORD_REQUEST_COMMAND
94 - SSID
s - ORD_DEFAULT_MODE_REQUEST_COMMAND
177 - payload length
1 - ORD_CLASSNAME_REQUEST_COMMAND_SCRIPT length
s - ORD_CLASSNAME_REQUEST_COMMAND_SCRIPT
3 - ORD_DEFAULT_SCRIPT_LANGUAGE lengh
SQL - ORD_DEFAULT_SCRIPT_LANGUAGE
BEGIN;\nCREATE VERTEX V SET num = 13\nCREATE VERTEX V SET num = 14\nCREATE EDGE E FROM (SELECT FROM V WHERE num = 13) TO (SELECT FROM V WHERE num = 14)\nCOMMIT; - commands

Tell me if I do something wrong, Thank you.

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

hi @crossknight

are you using any drivers? or just writing over the binary protocol?

which version of OrientDB exactly?

@crossknight
Copy link
Author

crossknight commented Jul 7, 2017

I just writing over the binary protocol. version of OrientDB is 2.2.22.

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

hi @crossknight

are you sending parameters in the batch script or only the plain text batch?

@crossknight
Copy link
Author

I'm not sure.
What is the batch script or only the plain text batch?
I followed instruction from this link
http://orientdb.com/docs/2.2.x/Network-Binary-Protocol.html
to generate binary command.

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

From here

http://orientdb.com/docs/2.2.x/Network-Binary-Protocol-Commands.html#script

are you sending only the text or also the parameters?

@crossknight
Copy link
Author

crossknight commented Jul 7, 2017

I'm sending only the text.

I set has-simple-parameters to 0 (false) and has-complex-parameters to 0 (false).

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

@crossknight

that is strange i was not able to reproduce it via studio with batch and with
orientjs driver. Did you try with Studio in Batch Mode?

@crossknight
Copy link
Author

Can you try this?

screen shot 2017-07-07 at 3 30 01 pm

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

hi @crossknight

screen shot 2017-07-07 at 10 40 01

Is that a fresh db?

if not can you provide this db, so i can try to reproduce it?

@crossknight
Copy link
Author

I changed to fresh new db and it works fine.
Do you need the problem db for checking?

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

Sure

you can send it to me here if it's small [email protected]

Thanks

@crossknight
Copy link
Author

I sent you an email with the problem db.
Thank you for your help.

@crossknight
Copy link
Author

I found the command that cause this problem.
I used this command on new db.
CREATE VERTEX V SET num = 10;

then these following commands will be failed
BEGIN;
CREATE VERTEX V SET num = 13;
CREATE VERTEX V SET num = 14;
CREATE EDGE E FROM (SELECT FROM V WHERE num = 13) TO (SELECT FROM V WHERE num = 14);
COMMIT;

@wolf4ood
Copy link
Member

wolf4ood commented Jul 7, 2017

ok Thanks

@wolf4ood wolf4ood assigned luigidellaquila and unassigned wolf4ood Jul 10, 2017
@wolf4ood wolf4ood added the bug label Jul 10, 2017
@luigidellaquila
Copy link
Member

Hi @crossknight

I pushed a fix for this a couple of days ago, the fix will be released with 2.2.23 in a few hours

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 2.2.23 milestone Jul 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants