[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you handle a schema update?



Hi,

> Since the ozone storage is based on the Java serialization mechanism you have
> to use the 'serialVersionUID' to get backwards compatiblity of you database
> classes. Please, read the regarding section in the Java documentation and look
> a the ozone examples.

Thanks for the hint. I used the serialVersionUID instance variable
and plain serialization is working fine. The problem seems to be in
ozone's ProxyGenerator. It calls a method by its index (CVS of
today, line 383). But the indices of methods of updated classes 
are different from those of the original classes if methods have
been added or removed. The error I get is an obscure class
cast error due to the fact that the wrong method with a different
return type seems to be called. 

I tried to change the ProxyGenerator back to use method names 
instead of method numbers, uncommenting the line just below the
line using the method numbers: 

  // out.print ("            Object result = link.invoke (this, " +
  //   OPPHelper.methodArrayIndex (methods, m) + ", args, " + (update ?
  //   "Lock.LEVEL_WRITE" : "Lock.LEVEL_READ") + ");\n");   out.print ("        
 Object result = link.invoke (this, \"" + m.getName() + "\", " + sig + ", args,
    " + (update ? "Lock.LEVEL_WRITE" : "Lock.LEVEL_READ") + ");\n");

But this does not work either. It seems now null is returned from link.invoke 
and I got stuck at this point. Any hints how to fix this? Why is the
statement using names commented out in favor of the one using
method indices? 

Thanks again for your help  
 & best regards
  Lars
-- 
Dr. Lars Schmidt-Thieme <Lars.Schmidt-Thieme@wiwi.uni-karlsruhe.de>
Institut für Entscheidungstheorie und Unternehmensforschung,
Universität Karlsruhe - Tel. 0721/608-8941