orientechnologies / orientdb-gremlin

TinkerPop3 Graph Structure Implementation for OrientDB
Apache License 2.0
91 stars 32 forks source link

Problem using standalone gremlin server with OrientDB #157

Closed soujiro32167 closed 5 years ago

soujiro32167 commented 5 years ago

Problem

I would like to setup an independent deployment of gremlin-server that would connect to OrientDB. This is useful because the server seems to only open preconfigured graphs. When I do this using the setup below, things go well until I send this query using gremlin console:

g.V().valueMap()

I get a ClassCastException:

Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote cannot be cast to com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded

in OrientStandardTransaction.doCommit()

Setup

docker-compose.yaml:

version: '3'
services:
  orientdb:
    image: orientdb:3.0.10
    ports:
      - "2480:2480"
      - "2424:2424"
    environment:
      - ORIENTDB_ROOT_PASSWORD=rootpwd
    entrypoint: ["sh", "-c", "./bin/console.sh 'CREATE DATABASE plocal:./databases/demodb'; server.sh"]

  gremlin-server:
    build: .
    image: gremlin-server-orientdb:3.3.5
    ports:
      - "8182:8182"
    depends_on:
      - orientdb

Dockerfile:

FROM tinkerpop/gremlin-server:3.3.5

# IMPORTANT: gremlin server containers only start from Gremlin Server 3.3.4.
# OrientDB gremlin server integration targets 3.3.0
# This causes a dependency conflict:
# 3.3.4 depends -> groovy-*-2.4.16
# 3.3.0 depends -> groovy-*-2.4.11
# Arbitrary resolution: fall back to 2.4.11

RUN apk add -U --no-cache curl \
  && bin/gremlin-server.sh install com.orientechnologies orientdb-gremlin 3.0.10 \
  && curl -o ext/orientdb-gremlin/plugin/orientdb-gremlin-server-3.0.10.jar https://search.maven.org/remotecontent?filepath=com/orientechnologies/orientdb-gremlin-server/3.0.10/orientdb-gremlin-server-3.0.10.jar \
  && rm lib/groovy-swing-2.4.*.jar lib/groovy-jsr223-2.4.*-indy.jar lib/groovy-xml-2.4.*.jar

COPY tinkergraph-empty.properties/

tinkergraph-empty.properties:

gremlin.graph=org.apache.tinkerpop.gremlin.orientdb.OrientFactory
orient-url=remote:orientdb/demodb
orient-user=admin
orient-pass=admin

Workaround

Using non-transactional setup resolves this: tinkergraph-empty.properties:

gremlin.graph=org.apache.tinkerpop.gremlin.orientdb.OrientFactory
orient-url=remote:orientdb/demodb
orient-user=admin
orient-pass=admin
orient-transactional=false
wolf4ood commented 5 years ago

Hi @soujiro32167

let me check on this

wolf4ood commented 5 years ago

Hi @soujiro32167

i've just pushed a fix, it will be available in the next release, 3.0.19

Thanks