英文:
EntityStoreException: Unsupported property type id 9
问题
使用Xodus版本 1.3.124
,数据库出现以下错误:
jetbrains.exodus.entitystore.EntityStoreException: 不支持的属性类型标识 9
at jetbrains.exodus.entitystore.tables.PropertyTypes.getPropertyType(PropertyTypes.java:56)
at jetbrains.exodus.entitystore.tables.PropertyTypes.entryToPropertyValue(PropertyTypes.java:86)
at jetbrains.exodus.entitystore.PersistentEntityStoreImpl.getPropertyValue(PersistentEntityStoreImpl.java:843)
at jetbrains.exodus.entitystore.PersistentEntityStoreImpl.getProperty(PersistentEntityStoreImpl.java:827)
at jetbrains.exodus.entitystore.PersistentEntity.getProperty(PersistentEntity.java:114)
尽管属性已经注册:
@Override
public PersistentEntityStore getPersistentEntityStore(String xodusRoot, String dir, boolean isReadOnly) {
if(persistentEntityStoreCache == null) {
persistentEntityStoreCache = buildPersistentEntityStoreCache();
}
PersistentEntityStore entityStore = persistentEntityStoreCache.get(xodusRoot + dir);
if (entityStore == null) {
Environment environment = getEnvironment(xodusRoot, dir);
PersistentEntityStoreConfig config = new PersistentEntityStoreConfig();
config.setManagementEnabled(false);
config.setDebugSearchForIncomingLinksOnDelete(true);
config.setRefactoringHeavyLinks(true);
entityStore = PersistentEntityStores.newInstance(config, environment, "persistentEntityStore");
PersistentEntityStore finalEntityStore = entityStore;
entityStore.executeInTransaction(
txn -> {
finalEntityStore.registerCustomPropertyType(
txn, EmbeddedEntityIterable.class, EmbeddedEntityBinding.BINDING);
finalEntityStore.registerCustomPropertyType(
txn, EmbeddedArrayIterable.class, EmbeddedEntityBinding.BINDING);
persistentEntityStoreCache.put(xodusRoot + dir, finalEntityStore);
});
}
PersistentEntityStore persistentEntityStore = persistentEntityStoreCache.get(xodusRoot + dir);
return persistentEntityStore;
}
而此属性最初保存为:
metaDataHashMap.put("uniqueProperties", uProperties);
finalEntity.setProperty(metadataProperty, new EmbeddedEntityIterable(metaDataHashMap));
可能出了什么问题?
英文:
Using Xodus version 1.3.124
and the database is throwing:
jetbrains.exodus.entitystore.EntityStoreException: Unsupported property type id 9
at jetbrains.exodus.entitystore.tables.PropertyTypes.getPropertyType(PropertyTypes.java:56)
at jetbrains.exodus.entitystore.tables.PropertyTypes.entryToPropertyValue(PropertyTypes.java:86)
at jetbrains.exodus.entitystore.PersistentEntityStoreImpl.getPropertyValue(PersistentEntityStoreImpl.java:843)
at jetbrains.exodus.entitystore.PersistentEntityStoreImpl.getProperty(PersistentEntityStoreImpl.java:827)
at jetbrains.exodus.entitystore.PersistentEntity.getProperty(PersistentEntity.java:114)
Despite the property being registered:
@Override
public PersistentEntityStore getPersistentEntityStore(String xodusRoot, String dir, boolean isReadOnly) {
if(persistentEntityStoreCache == null) {
persistentEntityStoreCache = buildPersistentEntityStoreCache();
}
PersistentEntityStore entityStore = persistentEntityStoreCache.get(xodusRoot + dir);
if (entityStore == null) {
Environment environment = getEnvironment(xodusRoot, dir);
PersistentEntityStoreConfig config = new PersistentEntityStoreConfig();
config.setManagementEnabled(false);
config.setDebugSearchForIncomingLinksOnDelete(true);
config.setRefactoringHeavyLinks(true);
entityStore = PersistentEntityStores.newInstance(config, environment, "persistentEntityStore");
PersistentEntityStore finalEntityStore = entityStore;
entityStore.executeInTransaction(
txn -> {
finalEntityStore.registerCustomPropertyType(
txn, EmbeddedEntityIterable.class, EmbeddedEntityBinding.BINDING);
finalEntityStore.registerCustomPropertyType(
txn, EmbeddedArrayIterable.class, EmbeddedEntityBinding.BINDING);
persistentEntityStoreCache.put(xodusRoot + dir, finalEntityStore);
});
}
PersistentEntityStore persistentEntityStore = persistentEntityStoreCache.get(xodusRoot + dir);
return persistentEntityStore;
}
And this property was originally saved with:
metaDataHashMap.put("uniqueProperties", uProperties);
finalEntity.setProperty(metadataProperty, new EmbeddedEntityIterable(metaDataHashMap));
What could be wrong here?
答案1
得分: 0
我已经找到了问题的根本原因。
最初,EmbeddedEntityIterable
位于 com.mybusiness.model.EmbeddedEntityIterable
,然后被移动到 com.my-new-business.model.EmbeddedEntityIterable
。
这解决了问题。然而,Xodus 应该提供一种机制来替换,或者至少在像这样的情况下替换引用,即模型被移动的情况下。
英文:
I have found the root cause of the problem.
Originally, the EmbeddedEntityIterable
is under com.mybusiness.model.EmbeddedEntityIterable
then was moved to com.my-new-business.model.EmbeddedEntityIterable
This solved the problem. However, it Xodus should have a facility to replace or at least replace references in cases like this the models are moved.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论