We don't do that, but I can't say whether it's a good idea or not. Hopefully one of the orient guys will chime in.
On Monday, October 27, 2014 5:40:01 AM UTC-6, [email protected] wrote: > > Hi Keith, > > Thanks a lot :) that clears many things. I've got another small question > about pools, should I keep track of current Pool to close/make new > openGraph ? > > if (Constants.orientDBfactory.getCreatedInstancesInPool() >= (10)) { > Constants.orientDBfactory.close(); > Constants.orientDBfactory = new OrientGraphFactory(Constants.orientDBURL, > x, y).setupPool(1, 10); > } > > or is this completely unnecessary? > > > On Sunday, October 26, 2014 1:59:48 PM UTC-5, Keith Freeman wrote: >> >> 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.
