Re: Re: [mdr-users] How are repositories supposed to be used by modules?

Martin Matula <[email protected]> Sat, 28 Sep 2002 19:14:25 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi Brian,
why don't you use:
       package Timestamps imports PrimitiveTypes {
           class Timestamp {
                 extentName : String
                 timestamp : Long
           }
       }

Martin

Brian Smith wrote:
> Martin Matula wrote:
> 
>> But it should definitely be used when you often load and delete data - 
>> i.e. you import the model, do something with it and then you drop it 
>> from the MDR. This is because the btree impl. is quite ineffective in 
>> freeing unused storage space and thus the storage file could grow 
>> quickly.
> 
> 
> Yes, this is what I am doing right now. Actually, the technique I tried 
> to use was:
> 
> 1. create extent
> 2. load model
> 3. perform processing
> 4. rollback transaction
> 
> Unfortunately, I was having some problems after doing rollbacks (MDR 
> seemed to think I was rolling back transactions twice, which I'm sure I 
> probably was). So, I changed to:
> 
> 1. create extent
> 2. load model
> 3. perform processing
> 4. delete extent
> 5. commit transaction
> 
> But, in the near future I will do something along the lines of:
> 
> 1. if extent exists and is out of date, delete it
> 2. If extent does not exist, create it and load model
> 3. commit transaction
> 4. perform processing
> 
> So, in this case, the B-Tree implementation would be better because I 
> can persist the models for days (years!) at a time without having to 
> re-parse them, assuming they don't change.
> 
> For #1, it would be nice to be able to associate a "last modified" 
> timestamp with an (outermost) extent. As a workaround I am thinking to 
> do build a simple metamodel:
>      package Timestamps imports PrimitiveTypes, Model {
>          class Timestamp {
>                element @ ModelElementTimestamp::element
>                timestamp : Long
>          }
>          association ModelElementTimestamp {
>                element : ModelElement [0..1]
>                timestamp : Timestamp
>          }
>      }
> 
> And then create a single Timestamp object for every outermost model 
> element (only). But, this is really kind of too fine-grained and 
> complicated for what I need since really I just need one timestamp per 
> repository. Also, it only works on the MOF 1.4 metamodel...
> 
> - Brian
>