[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

2111.0. "mcc_mir_write_attr_data" by BALZAC::MARKOWSKI () Wed Jan 15 1992 05:59

T.RTitleUserPersonal
Name
DateLines
2111.1using a MIRTOOK::CALLANDERMCC = My Constant CompanionWed Jan 15 1992 10:3939
    
    What needs to be understood is how the write is set up. If you do the
    write using the instance key (MCC_T_UID) of the instance that already
    exists, then the write attribute will overwrite the entry that already
    exists. What might be happening is that in the first MCC run you
    continually use the same key, in the second you might create a new one.
    
    That's a bit confusing, so let's review it from a design stand point.
    
    1) I assume that you have an instance repository to go along with your
    attribute repository. The attribute lookup is based upon retrieving the
    key for the instance it relates to from the instance MIR.
    
    2) Before writing a new value into the instance MIR you should check if
    the entry already exists; then it is up to your code to determine if it
    should continue or return an exception.
    
    3) The storage of data in the attribute MIR is free format. I tend to
    store my data using ILV constructs. Since my data is not attribute data
    (using the MSL definition of attribute), I use the partition code of 1
    for storing all data on each entity, and then within the partition I
    create an ILV construct (put_cons_begin) for each "entry" I have.
    
    4) Note that the attribute MIR is very much case and data type
    sensitive for all lookups. This means that it is up to your module to
    determine  how keys are to be stored. I translate all entity instances
    into their DNS identifiers, and then uppercase them so that all global
    instances in my MIR can be looked-up using the DNS fullname in all
    uppercase.
    
    ----------------------
    
    If this has gotten off track sorry. Try reviewing your design and see
    if you can find what is causing the behavior you are seeing. There are
    many potential reasons for it. If you have more questions please ask.
    (Matt any other input?)
    
    jill
    
2111.2I agree with Jill, look in the Instance RepositoryTOOK::GUERTINDon't fight fire with flamesWed Jan 15 1992 11:1513
    RE:.1
   
        Jill, super job in describing what's going on.  I think on item 4,
    you mean instance MIR, right?
   
    RE:.0
        Sylviane,
   
    Jill is right, check your *instance* repository.  The attribute
    repository generally only writes new records when the instance key
    changes.
   
   -Matt.
2111.3I've fixed the problem...BALZAC::MARKOWSKIWed Jan 15 1992 12:3714
    
    Thank's to both of you for answers but you can forget this stupid
    problem.
    
    I thought that the MCC_MIR_CREATE_INSTANCE function worked like the 
    MCC_MIR_CREATE_REPOSITORY function that is : if the entity instance 
    already exists, even so it returns the instance key.
    Absolutly not.
    It is necessary to call the MCC_MIR_READ_INSTANCE_KEY function to obtain 
    the instance key in case the entity instance already exists.
    
    sylviane.
    
    
2111.4Looks like a QAR on the SRM is neededNANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamFri Jan 17 1992 13:2216
Looks like a QAR on the SRM is needed -- oh but I have already QAR'd this!

	MCC_INTERNAL # 689

Either the SRM documentation should state that you should read the instance
key first and if you get NOENTITY then create it.

Or -- the create instance key should do it for you; if the instance already
exists give you the valid Id and the error ALRDYEXISTS.  Then you can make
up your own mind...accept the error and reject the command, or accept the
UID and continue.

I like putting the code inside the MIR routines ... so you don't have to
put in your, and his, and hers, etc...

/keith