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

Re: Serious Persistence Problem

On Thu, 20 Sep 2001 10:28:53 +0800
"Don Berendsen" <donberendsen@hotmail.com> wrote:

> Up until the last two weeks we have never had a problem with persistence in 
> Ozone. However recently a lot more classes (still only a few 100) and 
> objects (a few thousand) have been added to the database and now some 
> objects do not persist properly. The object state is changed immediately 
> after the method invocation but reverts to its original state after the 
> database is closed and reopened.
> We are using the '/*update*/ tag after interface methods to indicate the 
> methods that change object state. All the methods associated with the 
> problem have the '/*update*/' tag. There is no discernable difference in the 
> very few classes & methods where the problem occurs and others. On my 
> machine the problem disappeared when I changed the order of loading the 
> classes and objects, on another machine the problem continues.
> I noticed in the generated proxies all the method invocations  have a 
> Lock.LEVEL_READ. As I recall from earlier days that update methods had a 
> Lock.LEVEL_WRITE.  I haven't tested this exhaustively but in one case where 
> values weren't persisting I changed the method invocation to 
> Lock.LEVEL_WRITE and the value was then persisted properly.
> I'm using Ozone 1.0.1 running on NT4.0, JDK 1.3.1_01.
> Should the invocation of update methods in proxies have a Lock.LEVEL_WRITE?

Yes, update methods *MUST* have Lock.LEVEL_WRITE ! Perhaps there is
a problem with /*update*/ comment. E.g. it's not a good idea to 
declare the interface methods in two lines, where the update comment
is on the second line, e.g. something like that:

public void methodname( int argument )
    throws Exception; /*update*/

Write it in one line:

public void methodname( int argument ) throws Exception; /*update*/

If this doesn't work, you may use regulare expressions to tell
OPP which methods are update methods, e.g. all methods starting
with 'set'. The safest method is to write ocd files, which describe
exactly the lock level for each method.

Best Regards,

Gerd Mueller                                    gerd@smb-tec.com     
SMB GmbH                                  http://www.smb-tec.com
Post a message:         mailto:ozone-users@ozone-db.org
Unsubscribe:            mailto:ozone-users-request@ozone-db.org?body=unsubscribe
Contact administrator:  mailto:ozone-users-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/