orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

java.lang.ClassCastException in ONativeAsynchQuery while using ODatabaseDocumentTxPooled

Open ttf opened this issue 13 years ago • 0 comments

With the Upgrade from 1.2.0 to 1.3.0 the use of ONativeSynchQuery with a supplied pooled database connection seems to break with the following:

java.lang.ClassCastException: com.orientechnologies.orient.core.db.document.ODatabaseDocumentTxPooled cannot be cast to com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract
     at com.orientechnologies.orient.core.query.nativ.ONativeAsynchQuery.run(ONativeAsynchQuery.java:86)
     at com.orientechnologies.orient.core.query.nativ.ONativeSynchQuery.runFirst(ONativeSynchQuery.java:49)

example use (db is an ODatabaseDocumentPool retrieved ODatabaseDocumentTx)

new ONativeSynchQuery<OQueryContextNative>(db, "somecluster", new OQueryContextNative()) {
    @Override
    public boolean filter(OQueryContextNative record) {
        return record.go(); //some filter...
    }
}.run();

Kind Regards, Tim

ttf avatar Jan 03 '13 15:01 ttf