Re: Re: [mdr-users] How are repositories supposed to be used by modules?
Brian Smith <[email protected]> Thu, 26 Sep 2002 13:08:06 -0500
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Organization | CollabNet Hosting |
| Message-ID | <[email protected]> |
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