orientechnologies/orientdb

Cannot read OVertexDocument while using cached pool connection

Afler opened this issue · 1 comments

OrientDB Version: docker orientdb:3.2.32-tp3

Java Version: 17

OS: Windows 10

Expected behavior

Native query result type while using standard orientDB.open() connection
image
OrientDB and GraphFactory config

@Bean
public OrientDB orientDB() {
    return new OrientDB("remote:localhost",
            "root",
            "root",
            com.orientechnologies.orient.core.db.OrientDBConfig.defaultConfig());
}

@Bean
@ConditionalOnProperty(prefix = "ontology", name = "service", havingValue = "orientdb-tp3")
public OrientGraphFactory factory() {
    return new OrientGraphFactory("remote:localhost/%s".formatted(dbNameTp3),
            "root",
            "root");
}

Connection init

db = graphFactory.getDatabase(false, true);

Actual behavior

Native query result type while using cached pool as connection
image
Pool config

  OrientDBConfigBuilder poolCfg = new OrientDBConfigBuilder();
  poolCfg.addConfig(OGlobalConfiguration.DB_POOL_MIN, 5);
  poolCfg.addConfig(OGlobalConfiguration.DB_POOL_MAX, 10);

  pool = new ODatabasePool(orientDB, dbName, "root", "root", poolCfg.build());

Steps to reproduce

Start standalone orientdb-tp3 3.2.32 docker image with docker run -d --name orient-db-tp3 -p 2424:2424 -p 2480:2480 -e ORIENTDB_ROOT_PASSWORD=root orientdb:3.2.32-tp3
Add some vertex to DB
Try to read this vertex from Java API with db.query() using cached pool and using default orientDB.open() method
Witness different types of returned results

Hi,

This should be fixed in 3.2.33, could you double check it ?

Be aware as well that there is a case where the instance may still be invalid and it's when you create it by hand, ex:

var d = new ODocument("V");
database.save(d);
var res = database.query("select from V");

in this case the exact same instance that you create is returned !

you can make sure the correct instance is created by:

var d = database.newInstance("v");
database.save(d);
var res = database.query("select from V");

bye