Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read OVertexDocument while using cached pool connection #10280

Open
Afler opened this issue Aug 8, 2024 · 1 comment
Open

Cannot read OVertexDocument while using cached pool connection #10280

Afler opened this issue Aug 8, 2024 · 1 comment
Labels
Milestone

Comments

@Afler
Copy link

Afler commented Aug 8, 2024

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

@tglman tglman added the bug label Aug 8, 2024
@tglman tglman added this to the 3.2.x milestone Aug 8, 2024
@tglman tglman modified the milestones: 3.2.x, 3.2.33 Aug 28, 2024
@tglman
Copy link
Member

tglman commented Aug 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants