Issue #2425: Unexpected exception during query, if entity is not enhanced

Type: Bug ReoprtVersion: 2.7.6_06Priority: NormalStatus: ClosedReplies: 3
#1

Hello,

the entity TCVector is not enhanced and the enhancement check in the objectdb.conf is active.

And we got an unexpected exception in our main thread. Do you know why?
We had expected that the activated enhancement check would throw an exception.

In a parallel secondary thread we got the following ObjectDB log entry.
ObjectDb Log:
Enhancement of type com.btc.ep.vector.tc.internal.dmos.TCVector is old and cannot be used (5551311951470884858:7671006861730496270)

 

Caused by: com.objectdb.o.InternalException: Unexpected internal exception
        at com.objectdb.o.JPE.e(JPE.java:170)
        at com.objectdb.o.ERR.h(ERR.java:66)
        at com.objectdb.o.OBC.onObjectDBError(OBC.java:1582)
        at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:733)
        at com.btc.ep.base.dal.internal.services.PersistenceUtilityServiceImpl.getModelElementsByClass(PersistenceUtilityServiceImpl.java:267)
        at com.btc.ep.profilemigration.migrators.ProofResultMigrator.migrate(ProofResultMigrator.java:147)
        at com.btc.ep.profilemigration.application.internal.services.ProfileMigrationImpl.callMigrators(ProfileMigrationImpl.java:239)
        at com.btc.ep.profilemigration.application.internal.services.ProfileMigrationImpl.do_migrateProfile(ProfileMigrationImpl.java:212)
        ... 15 more
Caused by: java.lang.NullPointerException
        at com.objectdb.o.VAR.J(VAR.java:299)
        at com.objectdb.o.VAR.ZD(VAR.java:261)
        at com.objectdb.o.SYR.l(SYR.java:517)
        at com.objectdb.o.QRC.j(QRC.java:194)
        at com.objectdb.o.QRM.Z7(QRM.java:273)
        at com.objectdb.o.MST.Z7(MST.java:1003)
        at com.objectdb.o.WRA.Z7(WRA.java:313)
        at com.objectdb.o.WSM.Z7(WSM.java:117)
        at com.objectdb.o.QRR.k(QRR.java:260)
        at com.objectdb.o.QRR.i(QRR.java:154)
        at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:721)
        ... 19 more

 

#2

The log message "Enhancement of type com.btc.ep.vector.tc.internal.dmos.TCVector is old and cannot be used " indicates that the class is enhanced. However, the enhancement cannot be used and the class has to be built and enhanced again. This could happen, for example, if that class is a subclass of another entity class that was changed (e.g. a field was added) after that enhancement. Rebuilding and re-enhancing of all the entity classes is expected to solve this.

The exception is caused by an unexpected state of the type system. This might be the result of the previous error, so you may want to check if you still get the exception after rebuilding and re-enhancing of all the entity classes.

ObjectDB Support
#3

We found the reason for the issue.

The TCVector is really not enhanced and is created unintentionally in a parallel thread as entity structure in our main database by persist a TCVector whose transaction was rollback. Only the entity model structure of TCVector remains in the main database.
After that the TCVector was created in our secondary database and it seemed that the enhancement check didn't work correctly.
Last a query was executed on another entity in the main database and failed with the unexpected exception.

The solution was to prevent the creation of the TCVector entity model structure in our main database where the TCVector is not needed.
Then the enhancement check threw an error on the secondary database which is the expected behavior.

#4

Thank you for the update. It is strange that the error message indicates that the TCVector is enhanced. If it is a subclass of another enhanced class, this could be the result of inheriting some enhancement properties. If the class is not available to ObjectDB (maybe in the second thread) then it might have been enhanced as synthetic class by ObjectDB.

Anyway, if it works now then this issue can now be closed.

 

ObjectDB Support

Reply