You only need to create the factory once, then use getTx() as many times as 
you like.  Be sure to do the graph.shutdown() to "release" the OrientGraph 
instance, but DON'T close the factory until your app is ready to exit.

On Sunday, October 26, 2014 12:08:18 PM UTC-6, [email protected] wrote:
>
> Hi,
>
> I have the following setup
>
> User -> MultiplayerServer -> OrientDBServer
>
> MultiplayerServer is the one that always connects to OrientDBServer, 
> currently to connect to the database Im always doing the following:
>
> try {
>
> OrientGraphFactory orientDBfactory = new OrientGraphFactory(Constants.
> orientDBURL, x, y).setupPool(1,50);
> OrientGraph graph = orientDBfactory.getTx();
> Vertex vMode= graph.getVertex("#17:3");
> vMode.setProperty("stuff", "stuffValue");
> graph.commit();
>
> } catch (Exception e) {
>      System.out.println("ERROR: " + e.toString());
>      if (graph != null) {
> graph.rollback();
> }
> orientDBfactory.close();
> } finally {
> if (graph != (null)) {
> graph.shutdown();
> }
> orientDBfactory.close();
> }
>
>
> My question is, do I create and close each time a OrientGraphFactory? or 
> should I do that only once (at server startup) and leave it open?
>
> thanks a bunch!
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to