Corrupt database?

Jerry Bell jdbell at oxfordmetamedia.com
Mon May 11 17:18:40 UTC 2009


>
> Option 2:  What matters is that STBUser buffers in the repository all
> point consistently to the correct class version.  Write a script using
> MagmaFileTraverser to interrogate all of the Fixed buffers ("type =
> 3") where classId=126, check that their versions all are correct and
> consistent with their number of instVars of the Buffer
> (#objectInstSize).
>
> If they are all consistent, then connect a fresh MagmaSession to the
> database and commit your change to the mis-ordered OC.  Stop and
> dispose of all other running sessions, replace them with fresh ones.
>
>>>>

I started again with another copy of the "bad" database directory, so  
there have been no changes to the MaClassDefinitions.

I was able to get a MagmaFileTraverser connected and running.

I have 9 STBUser instances in my database.  7 claim to be version 4  
with 10 instance variables, 2 claim to be version 1 with 10 instance  
variables.  I believe all should be version 4 with 10 instance  
variables.   My  current image class definition has 10 ivars.

There are four versions of MaClassDefintions for STBUser.   They  
appear to be in the correct order in the OC, each one has more  
instance variables than the one before.  But I believe the version  
numbers are wrong.

OC Index 		version		# inst vars
1				2			5
2				3			6
3				4			9
4				1			10

I believe the image thinks that our current in-image version is 1  
because that is the version number of the last entry in the  
MaClassDefinitions for STBUser.   I think I should change the version  
numbers of each STBUser MaClassDefinition so they are in order from 1  
to 4, but I don't need to re-order the definitions.   This will mean  
that new instances of STBUser will be version 4, which is correct.

Finally, I should go through the 2 incorrect instances on disk and  
convert their class ID to 4 from 1.   Is this something that  
MagmaFileTraverser can handle?  I can change the buffer's values, but  
can I write the repaired buffer back to disk?

Thanks again,

Jerry Bell









More information about the Magma mailing list