The following Groovy script:

db = ODatabaseDocumentPool.global().acquire("remote:localhost/test", "admin"
, "admin");
db.command(new OCommandSQL("create class Test")).execute();
// other schema related SQL commands to create properties and indexes
root = new ODocument("Test");
root.save();



Throws this exception


Caught: com.orientechnologies.orient.core.exception.OStorageException: Error 
in creation of new cluster 'Test' of type: PHYSICAL
com.orientechnologies.orient.core.exception.OStorageException: Error in 
creation of new cluster 'Test' of type: PHYSICAL
    at com.orientechnologies.orient.core.storage.impl.local.paginated.
OLocalPaginatedStorage.addCluster(OLocalPaginatedStorage.java:516)
    at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.addCluster(
ODatabaseRaw.java:425)
    at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.
addCluster(ODatabaseWrapperAbstract.java:205)
    at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.
addCluster(ODatabaseWrapperAbstract.java:205)
    at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.
addCluster(ODatabaseRecordWrapperAbstract.java:77)
    at com.orientechnologies.orient.server.network.protocol.binary.
ONetworkProtocolBinary.addCluster(ONetworkProtocolBinary.java:542)
    at com.orientechnologies.orient.server.network.protocol.binary.
ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:289)
    at com.orientechnologies.orient.server.network.protocol.binary.
OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:
169)
    at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:
45)
Caused by: com.orientechnologies.orient.core.exception.
OConfigurationException: Cannot add segment 'test' because it is already 
registered in database 'test'
    at com.orientechnologies.orient.core.storage.impl.local.paginated.
OLocalPaginatedStorage.registerCluster(OLocalPaginatedStorage.java:2180)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.
OLocalPaginatedStorage.addClusterInternal(OLocalPaginatedStorage.java:2036)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.
OLocalPaginatedStorage.doAddCluster(OLocalPaginatedStorage.java:2013)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.
OLocalPaginatedStorage.addCluster(OLocalPaginatedStorage.java:513)
    ... 8 more

However this (or the same using the console) has no problems:

db = ODatabaseDocumentPool.global().acquire("remote:localhost/elasternity", 
"admin", "admin");
db.command(new OCommandSQL("create class Test")).execute();
db.command(new OCommandSQL("insert into Test set name = ''")).execute();

This is a part of a larger script that is first creating the schema for the 
classes and then performing some initial population.

I tried closing and reopening the DB connection, and the same thing 
happened.

So it seems like a bug in the ODocument() constructor?



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to