/** * set the laziness on query result reading * @param lazy boolean to set the query as lazy or not. */ public void setLazyQueries(boolean lazy){ readWrite(); this.threadLocalTx.get().setLazyQueries(lazy); }
/** * set the laziness on query result reading * @param lazy boolean to set the query as lazy or not. */ public void setLazyQueries(boolean lazy){ readWrite(); this.threadLocalTx.get().setLazyQueries(lazy); }
/** * get fetch size for current transaction * @return */ public Integer getFetchSize() { readWrite(); return this.threadLocalTx.get().getFetchSize(); }
/** * set fetch size for current transaction * @param fetchSize */ public void setFetchSize(Integer fetchSize) { readWrite(); this.threadLocalTx.get().setFetchSize(fetchSize); } }
public Connection getConnection() { if (!isOpen()) { readWrite(); } return this.threadLocalTx.get().getConnection(); }
@Override public Set<String> keys() { this.sqlgGraph.tx().readWrite(); return this.internalGetProperties().keySet(); }
public Connection getConnection() { if (!isOpen()) { readWrite(); } return this.threadLocalTx.get().getConnection(); }
@Override public Set<String> keys() { this.sqlgGraph.tx().readWrite(); return this.internalGetProperties().keySet(); }
public void streamingWithLockBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.STREAMING_WITH_LOCK); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public void normalBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.NORMAL); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public void streamingBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.STREAMING); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public void normalBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.NORMAL); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
@Override public Iterator<Vertex> vertices(Direction direction) { SqlgEdge.this.sqlgGraph.tx().readWrite(); return internalGetVertices(direction); }
@SuppressWarnings("unchecked") @Override public <V> VertexProperty<V> property(final String key, final V value) { if (this.removed) { throw new IllegalStateException(String.format("Vertex with id %s was removed.", id().toString())); } ElementHelper.validateProperty(key, value); this.sqlgGraph.tx().readWrite(); return (VertexProperty<V>) super.property(key, value); }
@SuppressWarnings("unchecked") @Override public <V> VertexProperty<V> property(final String key, final V value) { if (this.removed) { throw new IllegalStateException(String.format("Vertex with id %s was removed.", id().toString())); } ElementHelper.validateProperty(key, value); this.sqlgGraph.tx().readWrite(); return (VertexProperty<V>) super.property(key, value); }
@Override public Iterator<Vertex> vertices(Object... vertexIds) { this.tx().readWrite(); if (this.sqlDialect.supportsBatchMode() && this.tx().getBatchManager().isStreaming()) { throw new IllegalStateException("streaming is in progress, first flush or commit before querying."); } return createElementIterator(Vertex.class, vertexIds); }
@Override public void remove() { this.sqlgGraph.tx().readWrite(); if (this.removed) throw new IllegalStateException(String.format("Edge with id %s was removed.", id().toString())); if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { this.sqlgGraph.tx().getBatchManager().removeEdge(this.schema, this.table, this); } else { super.remove(); } }
@Override public void remove() { this.sqlgGraph.tx().readWrite(); if (this.removed) throw new IllegalStateException(String.format("Edge with id %s was removed.", id().toString())); if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { this.sqlgGraph.tx().getBatchManager().removeEdge(this.schema, this.table, this); } else { super.remove(); } }
@Override public Iterator<Edge> edges(Object... edgeIds) { this.tx().readWrite(); if (this.getSqlDialect().supportsBatchMode() && this.tx().getBatchManager().isStreaming()) { throw new IllegalStateException("streaming is in progress, first flush or commit before querying."); } return createElementIterator(Edge.class, edgeIds); }
@Override public Iterator<Edge> edges(Direction direction, String... edgeLabels) { SqlgVertex.this.sqlgGraph.tx().readWrite(); if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) { throw new IllegalStateException("streaming is in progress, first flush or commit before querying."); } return internalEdges(direction, edgeLabels); }