ObjectDB ObjectDB

Complex Schema Upgrade not working

#1

Hello,

We're trying to upgrade the DB-Schema. Simplied our source/original Schema/Class-Hierarchy looked like this:

class contact.Contact
class customer.Customer extends contact.Contact
class member.Member extends customer.Customer

We have database records within each class type (Contact, Customer and Member).

Our new hierarchy looks like that:
- The package "member" has been renamed to package "address"
- All fields and methods from classes "contact.Contact" and "customer.Customer" have been merged into the member.Member class
- The member.Member class is now the address.Address class

We've added the schema upgrade to the objectdb.conf:

<schema>
  <package name="old-package.contact" new-name="new-package.contact">
    <class name="Contact" new-name="new-package.address.Address"/>
  </package>
  <package name="old-package.customer" new-name="new-package.customer">
    <class name="Customer" new-name="new-package.address.Address"/>
  </package>
  <package name="old-package.member" new-name="new-package.address">
    <class name="Member" new-name="Address"/>
  </package>
</schema>

Only renaming packages worked well but when trying to make a schema upgrade with the classes results in the previous Contact and Customer tables to be empty as well as the new Address class' table has no records either.

However, looking at the DB-Size, it still has the same size?

The DB-Server has been properly restarted. All other classes which just had package renames are working well.

Any idea?

edit
delete
#2

The configuration XML is not synchronized with the example (in package names), but this is probably only in this post and not in your application.

The ObjectDB schema evolution support consists of:

Changing package and class names requires setting in the configuration, but moving fields in the hierarchy is managed automatically and should not be specified in the configuration. If you have instances of Contact and Customer in the database, which have to be converted to Address instances, you will have to write some conversion code.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.