Issue using OrientGraphFactory

323 views
Skip to first unread message

Alessandro Remartini

unread,
Feb 17, 2014, 10:45:03 AM2/17/14
to orient-...@googlegroups.com
Dear all,

I have included new 1.7-rc1 libraries in my Netbeans web project (I used 1.6 version) and I have introduced the use of OrientGraphFactory in the new package orientdb-graphdb-1.7-rc1.jar. The libraries included in my project are:

javassist-3.16.1-GA.jar
orient-commons-1.7-rc1.jar
orientdb-core-1.7-rc1.jar
orientdb-client-1.7-rc1.jar
orientdb-enterprise-1.7-rc1.jar
blueprints-core-2.5.0-20140129.150537-29.jar
orientdb-graphdb-1.7-rc1.jar

and the new code snippet to instantiate the OrientGraph is become:

 try{
OrientGraphFactory factory;          
factory = new OrientGraphFactory("remote:localhost/HRG","admin","admin");
factory.setupPool(1, 10);
_hrgGraph = factory.getTx();
factory.close();
}catch ( Exception e){
return false;
}

There is a strange behavior, because the factory.setupPool (1,10) statement causes the skip of the next instructions without generate exception.

Please, anyone can help me?

Thanks for your help

Regards

Alessandro
        

Luca Garulli

unread,
Feb 17, 2014, 10:47:44 AM2/17/14
to orient-database
Hi,
what's the expected result?

Lvc@



--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alessandro Remartini

unread,
Feb 17, 2014, 11:05:29 AM2/17/14
to orient-...@googlegroups.com
Hi Luca,

the expected result is the creation of an instance of OrientGraph class (to manage the graph database HRG).

Thanks

Alessandro

Luca Garulli

unread,
Feb 17, 2014, 11:09:16 AM2/17/14
to orient-database
Hi Alessandro,
I don't understand the problem. You wrote: "because the factory.setupPool (1,10) statement causes the skip of the next instructions without generate exception". So the line:

_hrgGraph = factory.getTx();

is skipped without an exception?

Lvc@

Alessandro Remartini

unread,
Feb 17, 2014, 11:18:49 AM2/17/14
to orient-...@googlegroups.com
Exactly..very strange..the execution of factory.setupPool (1,10) causes the skip of the _hrgGraph = factory.getTx(); instruction and also of the followers, and leads to the finally branch of the try..catch block.

I also try to remove the setupPool invocation, but, in the same way, the execution of _hrgGraph = factory.getTx(); leads to the finally branch of the try..catch block without exception...

It seem that the use of factory object cause this strange behavior...

Thanks

Alessandro


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/JYcM6mHxbFE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Luca Garulli

unread,
Feb 17, 2014, 11:30:33 AM2/17/14
to orient-database
Hi Alessandro,
this doesn't depend by OrientDB: it's Java! Try to clean everything or to insert some print, specially in the catch block.

Lvc@

Alessandro Remartini

unread,
Feb 17, 2014, 12:00:49 PM2/17/14
to orient-...@googlegroups.com
Hi Luca,

I have added a system.out in catch branch a s you can see below:


OrientGraphFactory factory;          
            factory = new OrientGraphFactory("remote:localhost/HRG", "admin", "admin");
            factory.setupPool(1, 10);
          
            System.err.println("after pool setup");
          
            _hrgGraph = factory.getTx();
            factory.close();
            return true;
        } catch (Exception e) {
            System.err.println(e.getMessage());
            return false;
        } finally {
            System.err.println("finally");
        }

but I think that it is not Java the problem.

In fact, I have tried to shut down OrientDB server and running the project and the exception correctly

reported is

Cannot connect to any configured remote nodes: 127.0.0.1:2424

traced in the catch branch. Starting the OrientDB server and running the project, there is no exception

and after the execution the trace is only "finally" and the catch branch is skipped and the 

Alessandro Remartini

unread,
Feb 17, 2014, 12:11:56 PM2/17/14
to orient-...@googlegroups.com
Hi Luca,

sorry, I rewrite the message (wrongly formatted):


I have added a system.out in catch branch a s you can see below:

            OrientGraphFactory factory;          
            factory = new OrientGraphFactory("remote:localhost/HRG", "admin", "admin");
            factory.setupPool(1, 10);
          
            System.err.println("after pool setup");
          
           _hrgGraph = factory.getTx();
            factory.close();
            return true;
        } catch (Exception e) {
            System.err.println(e.
getMessage());
            return false;
        } finally {
            System.err.println("finally");
        }


but I think that it is not Java the problem.

In fact, I have tried to shut down OrientDB server and running the project and the exception correctly reported is:

Cannot connect to any configured remote nodes: 127.0.0.1:2424

traced by the catch branch. Starting the OrientDB server and running the project, there is no exception and after the execution the trace is only "finally" and the catch branch is skipped and the execution goes in the finally branch.

I want to know if the libraries included are right and if the code is correct from your point of you.


Thanks for your help

Regards

Alessandro
Reply all
Reply to author
Forward
0 new messages