question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

suggestion: Not to throw when no edges created.

See original GitHub issue

Currently, CREATE EDGE throws an exception when FROM statement or TO statement were not found.

https://github.com/orientechnologies/orientdb/blob/ad7cbed6c7c5b3f920713d93bc8c98b219c200c8/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/OCommandExecutorSQLCreateEdge.java#L213-L219

        if (edges.isEmpty()) {
          if (fromIds.isEmpty())
            throw new OCommandExecutionException("No edge has been created because no source vertices");
          else if (toIds.isEmpty())
            throw new OCommandExecutionException("No edge has been created because no target vertices");
          throw new OCommandExecutionException("No edge has been created between " + fromIds + " and " + toIds);
        }

Imagine you want to create possibly multiple edges from a RID to a sub-query. The result of sub-query could be empty, it’s not deterministic. If you want to make sure that the edges will be created, than you should select-and-create in a transaction. Why don’t you let it go and just return a number of edges that actually created. I think it’s not only easier to handle it, but also give better performance.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ahlbejescommented, May 26, 2016

+1 It is really the behavior I expected. It is a hassle to have to be sure both source and destination sets are not empty before executing the create edge command, or to have to handle the exception messages.

0reactions
luigidellaquilacommented, Jan 21, 2016

Hi guys,

The general case is that you can create a set of edges from a set of vertices to another set of vertices.

By definition, sets can be empty, so it makes sense to just create no edges.

-1 to the idea of adding another keyword, the language is already too cluttered by keywords to manage corner cases, the statement will just return the number of edges that were created.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for exceptions - .NET - Microsoft Learn
This section describes best practices for handling and creating exceptions. ... Handle common conditions without throwing exceptions.
Read more >
Creature under suggestion spell is attacked by caster, does ...
My questions are specifically: 1- Does creature B stop playing and try to defend from the attack? 2- Does the spell breaks? 3-...
Read more >
Ch.7 Unit Test Flashcards - Quizlet
Study with Quizlet and memorize flashcards containing terms like Read this excerpt from "Look Homeward, Angel." And whatever he touched in that rich ......
Read more >
Disable input text suggestions in Edge? - Stack Overflow
Added advantage is that it's pure HTML, no CSS or JS required. ... This worked for Edge & Chrome (not a login form...
Read more >
Working Safely with Sharp Blades or Edges : OSH Answers
Place the tool at the back of the counter when not in use, with the sharp edge away from you. Store tools appropriately....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found