Comments (8)
The 0.5.1 does not contain any changes to the database format, you should be able to simply install 0.5.1 over 0.5.0 and continue working (unless you somehow rely on ZooDB changed behavior on Serializing persistent objects, see issues #111, #112).
The error message indicates that ZooDB tries to read an object from the database, but it cannot find a matching Java class. I can't easily see what's going on, either the class with the required name does not exist or the fields (type/name) of the Java class don't quite match the stored fields in the database.
My thoughts:
- Is it possible that any of your stored classes have changed? That may not necessarily be persistent classes (subclasses of ZooPC of PersistentCapableImpl) but could also be classes that are 'serialized' as SCOs (Second Class Objects) into the DB. This happens when when a persistent capable Objects references a non-persistentcapable object, then the non-persistent-capable object is serialized into a field of the persistent capable object.
- Can you confirm that the old database still works when you put 0.5.0 back into place?
- Could you post the stack trace, maybe I can tell more.
from zoodb.
@tzaeschke yep, looks like thought1 is the case, during updating I've added few fields to one of persistent classes.
But what is supposed to be correct procedure for migration in such case? Export and re-import?
from zoodb.
Export and reimport is the simplest if your environment allows that (you are DB-Admin, database not too large, ...).
Otherwise you can use the ZooDB's schema evolution API. It work a bit like Java reflection but allows you to add/remove fields to classes or add/remove classes from the database.
I'm currently writing a Wiki page on how to do this, it should be finished later today. You can also find example in the JUnit tests, for example in Test_034_SchemaEvolution
.
In any case, the message you got is not very descriptive, so I consider this an error in ZooDB. Could you give a more detailed explanation of what you did? Maybe (if you have time) in a separate Issue, possibly with a small example program?
from zoodb.
@tzaeschke Thank you, it's clear now.
Don't consider that case as error, because actually message was quite informative, it's just me cannot understand it properly.
Caused by: javax.jdo.JDOUserException: Class has not been fully evolved (0.0.0.250): vx.domain.Text (0.0.0.247) super=vx.domain.Content (0.0.0.218) super=vx.domain.Node (0.0.0.214) super=vx.domain.Persistent (0.0.0.201) super=org.zoodb.api.impl.ZooPC (0.0.0.50) super=null
NestedThrowables:
null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.zoodb.internal.util.ReflTools.newInstance(ReflTools.java:211)
at org.zoodb.internal.util.DBLogger.newEx(DBLogger.java:108)
at org.zoodb.internal.util.DBLogger.newEx(DBLogger.java:99)
at org.zoodb.internal.util.DBLogger.newUser(DBLogger.java:112)
at org.zoodb.internal.DataDeSerializer.hollowForOid(DataDeSerializer.java:1061)
at org.zoodb.internal.DataDeSerializer.deserializeObject(DataDeSerializer.java:675)
at org.zoodb.internal.DataDeSerializer.deserializeArrayColumn(DataDeSerializer.java:862)
at org.zoodb.internal.DataDeSerializer.deserializeArray(DataDeSerializer.java:783)
at org.zoodb.internal.DataDeSerializer.deserializeObjectSCO(DataDeSerializer.java:596)
at org.zoodb.internal.DataDeSerializer.deserializeFields2(DataDeSerializer.java:423)
at org.zoodb.internal.DataDeSerializer.readObjPrivate(DataDeSerializer.java:312)
at org.zoodb.internal.DataDeSerializer.readObject(DataDeSerializer.java:186)
at org.zoodb.internal.server.index.ObjectPosIterator.findNext(ObjectPosIterator.java:69)
at org.zoodb.internal.server.index.ObjectPosIterator.<init>(ObjectPosIterator.java:51)
at org.zoodb.internal.server.DiskAccessOneFile.readAllObjects(DiskAccessOneFile.java:289)
at org.zoodb.internal.model1p.Node1P.loadAllInstances(Node1P.java:141)
at org.zoodb.internal.Session.loadAllInstances(Session.java:476)
at org.zoodb.internal.Session.loadAllInstances(Session.java:481)
at org.zoodb.internal.Session.loadAllInstances(Session.java:481)
at org.zoodb.internal.Session.loadAllInstances(Session.java:481)
at org.zoodb.internal.Session.loadAllInstances(Session.java:459)
at org.zoodb.jdo.impl.ExtentImpl.iterator(ExtentImpl.java:99)
from zoodb.
Thanks. It appears the problem happened when it tried to read an array of persistent objects, and I guess on of the objects in the array caused the problem.
Ideally the message would explain why the class was not fully evolved (such as 'field xyz missing') and what the solution would be ('please add field xyz').
I'm asking because a better message actually exists, but for some reason you got this 'not fully evolved' instead, which I didn't expect to be shown to users.
Maybe you could just describe very briefly:
- Whether
vx.domain.Text
was in fact referenced from another persistent object through an array of Objects, for example a fieldprivate Text[] xyz;
? - What kind of change happened in
vx.domain.Text
, maybe a field was added/renamed/removed?
Thanks a lot.
from zoodb.
-
No, there is no direct reference to Text from other persistent objects.
But there is indirect polymorphic reference, i.e. Node[] children in other persistent classes, and Text is usually present in such arrays (inheritance chain Text -> Content -> Node). -
The only change to Text was:,
private String tags;
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags;
}
And also one field with getter/setter was added to its predecessor Content.
from zoodb.
@slavap Okay, thanks. That may explain it, I will try to reproduce it.
from zoodb.
Related to #71
from zoodb.
Related Issues (20)
- PersistenceManagerFactory getPersistenceManager() hangs up in case there is active transaction. HOT 5
- verboseToLog in DBLogger.java HOT 2
- Improve collection storage
- DB file format changes
- "Page type mismatch" after removing index HOT 7
- Removing index does sometimes not work HOT 1
- (De-)Serializing an PC object should make it DETACHED
- Detached object should not get a new OID when reattached
- Concurrent sessions may lead DB using wrong 'head' on start-up
- Implement tool to display database file format version
- Performance decrease wrongly HOT 5
- Improve byte array/buffer handling when reading from storage
- Page type mismatch, expected 4/OID_INDEX (tx=0) but got 0, PageId=718102 HOT 7
- Concurrent use of the same Query instance is not always threadsafe
- IllegalArgumentException: Can not set final [..].HashMap field [..].IdentificationKeys.proteinMap to java.lang.Long HOT 24
- Query on auto-created (and uncommitted) schema causes exception
- Investigate Java 18 (and 9) security implications
- Check whether Java 17 removal of RMI Activation (JEP 407) affects unit tests.
- multithreaded commit() may hang after updating schema HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zoodb.