- SCLContext sclContext = SCLContext.getCurrent();
- Object oldGraph = sclContext.put("graph", graph);
- try {
- return q.apply(Tuple0.INSTANCE);
- } catch (Throwable e) {
- if(e instanceof DatabaseException)
- throw (DatabaseException)e;
- else
- throw new DatabaseException(e);
- } finally {
- sclContext.put("graph", oldGraph);
- }