Closed efenzha closed 3 years ago
Hi @efenzha
Could you please post a SQL script to reproduce it exactly?
Thanks
Luigi
Hi @luigidellaquila ,
The ERROR is logged when connectiong to database from code:
val graph = new OrientGraphNoTx(dbUrl)
How to create a "SQL script" to reproduce it?
Hi @efenzha
I just need the exact commands you execute in console
Thanks
Luigi
Hi @luigidellaquila ,
but it has no relation with console, the error is printed when running the code val graph = new OrientGraphNoTx(dbUrl)
Did I misunderstand your meaning?
Hi @efenzha
OK
how do you create a vertex type if you still did not connect to the db? Are you using the console? Studio? Which is the sequence of commands you are executing?
Java connection? From remote or plocal?
Thanks
Luigi
Luigi
Hi @luigidellaquila ,
create a new vertex type from code, and set an index. ` val graph = new OrientGraphNoTx(dbUrl)
try { if (graph.getVertexType("EiffelEvent") == null) { graph.command(new OCommandSQL("ALTER DATABASE DATETIMEFORMAT \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"")).execute()
val eType = graph.createVertexType("EiffelEvent")
eType.createProperty("eventId", OType.STRING)
eType.createProperty("eventType", OType.STRING)
eType.createProperty("eventTime", OType.DATETIME)
eType.createProperty("stage", OType.STRING)
eType.createProperty("moreInfo", OType.STRING)
eType.setOverSize(3)
graph.createKeyIndex("eventId", classOf[Vertex], new Parameter("type", "UNIQUE"), new Parameter("class", "EiffelEvent"))
}
if (graph.getEdgeType("inputEventId") == null) { graph.createEdgeType("inputEventId") } } finally { graph.shutdown() } `
connect to this database
val graph = new OrientGraphNoTx(dbUrl)
orientDb url
orientdb.iurl=remote:ssekilxv7869.rnd.ericsson.se/fromMongo1
Hi @efenzha
Thank you very much. So you are using the legacy TinkerPop 2.6 API, is there any specific reason for doing it?
If you have a chance I strongly suggest you to use the MultiModel API https://orientdb.com/docs/3.0.x/java/Java-MultiModel-API.html
(or in case the new TinkerPop 3).
I have to double-check it, but I suspect the problem is due to the usage of the usage of the index APIs and how the legacy API uses them. I'd suggest to replace the API call with a simple SQL statement:
CREATE INDEX EiffelEvent.eventId on EiffelEvent (eventId) UNIQUE
It should solve the problem
Thanks
Luigi
Oh, and please double-check that the client and server have the exact same version (eg. both 3.0.18), as it could lead to such kind of problems
Thanks
Luigi
Hi @luigidellaquila ,
No, SQL does not solve this problem.
graph.command(new OCommandSQL("CREATE INDEX EiffelEvent.eventId on EiffelEvent (eventId) UNIQUE")).execute()
The index is created successfully, it is shown from Console.
I checked the client version, it is 3.0.18, same as server.
I am using 2.6 API since I follow orientdb java api examples. Maybe I need to use this multi model api, it sounds better.
This is an example print stack. It complains all classes in this database.
19/06/11 09:11:43 ERROR OIndexManagerRemote: Error on loading of index by configuration: {type:UNIQUE,name:ORole.name,indexVersion:2,indexDefinition:{className:ORole,field:name,keyType:STRING,collate:ci,nullValuesIgnored:false},indexDefinitionClass:com.orientechnologies.orient.core.index.OPropertyIndexDefinition,clusters:[1],algorithm:CELL_BTREE,valueContainerAlgorithm:NONE} java.lang.IllegalArgumentException: COLLATE cannot be null at com.orientechnologies.orient.core.index.OAbstractIndexDefinition.setCollate(OAbstractIndexDefinition.java:47) at com.orientechnologies.orient.core.index.OAbstractIndexDefinition.setCollate(OAbstractIndexDefinition.java:55) at com.orientechnologies.orient.core.index.OPropertyIndexDefinition.serializeFromStream(OPropertyIndexDefinition.java:174) at com.orientechnologies.orient.core.index.OPropertyIndexDefinition.fromStream(OPropertyIndexDefinition.java:139) at com.orientechnologies.orient.core.type.ODocumentWrapperNoClass.fromStream(ODocumentWrapperNoClass.java:44) at com.orientechnologies.orient.core.index.OIndexAbstract.loadMetadataInternal(OIndexAbstract.java:127) at com.orientechnologies.orient.core.index.OIndexManagerRemote.fromStream(OIndexManagerRemote.java:162) at com.orientechnologies.orient.core.type.ODocumentWrapperNoClass.reload(ODocumentWrapperNoClass.java:66) at com.orientechnologies.orient.core.index.OIndexManagerAbstract.load(OIndexManagerAbstract.java:104) at com.orientechnologies.orient.core.db.document.OSharedContextRemote.load(OSharedContextRemote.java:33) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.loadMetadata(ODatabaseDocumentRemote.java:278) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.initAtFirstOpen(ODatabaseDocumentRemote.java:263) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.internalOpen(ODatabaseDocumentRemote.java:229) at com.orientechnologies.orient.core.db.OrientDBRemote.open(OrientDBRemote.java:86) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:898) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:2016) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:191) at com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.<init>(OrientGraphNoTx.java:66)
OrientDB Version: orientdb-3.0.18
Java Version: 1.8.0_152
OS: linux
Expected behavior
connect to database without ERROR log
Actual behavior
ERROR log is reported, but can connect to database successfully
Steps to reproduce
every time, every time, every time, every time for every Index, even for class OFunction