use of org.openkilda.persistence.context.PersistenceContext in project open-kilda by telstra.
the class GraphSupplier method get.
@Override
public OrientGraph get() {
PersistenceContext context = PersistenceContextManager.INSTANCE.getContextCreateIfMissing();
OrientDbContextExtension contextExtension = implementation.getContextExtension(context);
DelegatingFramedGraph<OrientGraph> wrapper = contextExtension.getGraphCreateIfMissing();
if (wrapper == null) {
throw new PersistenceException("Failed to obtain a framed graph");
}
return wrapper.getBaseGraph();
}
use of org.openkilda.persistence.context.PersistenceContext in project open-kilda by telstra.
the class HibernateTransactionAdapter method getSessionFactory.
private SessionFactory getSessionFactory() {
PersistenceContext context = PersistenceContextManager.INSTANCE.getContextCreateIfMissing();
HibernateContextExtension contextExtension = getImplementation().getContextExtension(context);
return contextExtension.getSessionFactoryCreateIfMissing();
}
use of org.openkilda.persistence.context.PersistenceContext in project open-kilda by telstra.
the class TransactionManager method clearContext.
private void clearContext() {
log.debug("Remove global transaction tracking in {}", Thread.currentThread().getName());
PersistenceContext context = PersistenceContextManager.INSTANCE.getContextCreateIfMissing();
context.clearTransaction();
}
use of org.openkilda.persistence.context.PersistenceContext in project open-kilda by telstra.
the class FermaGenericRepository method framedGraph.
protected FramedGraph framedGraph() {
PersistenceContext context = PersistenceContextManager.INSTANCE.getContextCreateIfMissing();
FermaContextExtension contextExtension = implementation.getContextExtension(context);
DelegatingFramedGraph<?> graph = contextExtension.getGraphCreateIfMissing();
if (graph == null) {
throw new PersistenceException("Failed to obtain a framed graph");
}
return graph;
}
use of org.openkilda.persistence.context.PersistenceContext in project open-kilda by telstra.
the class DatabaseSupportImpl method getGraph.
private FramedGraph getGraph() {
PersistenceContext context = PersistenceContextManager.INSTANCE.getContextCreateIfMissing();
OrientDbContextExtension contextExtension = orientPersistenceImplementation.getContextExtension(context);
return contextExtension.getGraphCreateIfMissing();
}
Aggregations