Giter Site home page Giter Site logo

Comments (8)

tzaeschke avatar tzaeschke commented on June 13, 2024

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:

  1. 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.
  2. Can you confirm that the old database still works when you put 0.5.0 back into place?
  3. Could you post the stack trace, maybe I can tell more.

from zoodb.

slavap avatar slavap commented on June 13, 2024

@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.

tzaeschke avatar tzaeschke commented on June 13, 2024

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.

slavap avatar slavap commented on June 13, 2024

@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.

tzaeschke avatar tzaeschke commented on June 13, 2024

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 field private Text[] xyz;?
  • What kind of change happened in vx.domain.Text, maybe a field was added/renamed/removed?

Thanks a lot.

from zoodb.

slavap avatar slavap commented on June 13, 2024

@tzaeschke

  1. 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).

  2. 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.

tzaeschke avatar tzaeschke commented on June 13, 2024

@slavap Okay, thanks. That may explain it, I will try to reproduce it.

from zoodb.

tzaeschke avatar tzaeschke commented on June 13, 2024

Related to #71

from zoodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.