public UmlgSqlgGraph(Configuration config) { this.sqlG = SqlgGraph.open(config); this.transactionEventHandler = new UmlgTransactionEventHandlerImpl(); }
public static <G extends Graph> G open(final Configuration configuration) { SqlgDataSource dataSource = createDataSource(configuration); try { return open(configuration, dataSource); } catch (Exception ex) { dataSource.close(); throw ex; } }
public static <G extends Graph> G open(final Configuration configuration) { SqlgDataSource dataSource = createDataSource(configuration); try { return open(configuration, dataSource); } catch (Exception ex) { dataSource.close(); throw ex; } }
SqlgGraph getSqlgGraph(boolean distributed) { Configuration configuration = getConfiguration(); configuration.addProperty("distributed", distributed); return SqlgGraph.open(configuration); }
public static <G extends Graph> G open(final String pathToSqlgProperties) { if (null == pathToSqlgProperties) throw Graph.Exceptions.argumentCanNotBeNull("pathToSqlgProperties"); Configuration configuration; try { configuration = new PropertiesConfiguration(pathToSqlgProperties); SqlgDataSource dataSource = createDataSource(configuration); try { return open(configuration, dataSource); } catch (Exception ex) { dataSource.close(); throw ex; } } catch (ConfigurationException e) { throw new RuntimeException(e); } }
public static <G extends Graph> G open(final String pathToSqlgProperties) { if (null == pathToSqlgProperties) throw Graph.Exceptions.argumentCanNotBeNull("pathToSqlgProperties"); Configuration configuration; try { configuration = new PropertiesConfiguration(pathToSqlgProperties); SqlgDataSource dataSource = createDataSource(configuration); try { return open(configuration, dataSource); } catch (Exception ex) { dataSource.close(); throw ex; } } catch (ConfigurationException e) { throw new RuntimeException(e); } }
SqlgGraph sqlgGraph = SqlgGraph.open(configuration); this.umlgGraph = new UmlgSqlgGraph(sqlgGraph); if (!sqlgGraph.getTopology().getVertexLabel(sqlgGraph.getSqlDialect().getPublicSchema(), UmlgGraph.ROOT_VERTEX).isPresent()) {
/** * Executes the supplied task with a new Sqlg graph. */ public void execute(SqlgTask task) throws Exception { SqlgGraph sqlgGraph = SqlgGraph.open(sqlgConfiguration(configuration), sqlgDataSourceFactory(configuration)); sqlgGraph.tx().onClose(Transaction.CLOSE_BEHAVIOR.ROLLBACK); try { task.run(sqlgGraph); } finally { sqlgGraph.close(); } }