[TransWarp] Transaction-Handling in DataModel and default values at creation time ...

Ulrich Eck ueck at net-labs.de
Fri May 17 08:08:52 EDT 2002


Hi Phillip,

while working on LDAPModel .. i needed to inspect Transaction-handling more 
in detail.

when adding types to records (setType) the record is not registered in the 
transation.

so i have this problem:
lets say i just create a record, that should be stored with it's default 
values
or only needs it's key values (e.g. folderish storage in LDAP) it is not 
registered,
and therefore never created.

in _setTypeFor i initially used record.loadDefaults + record.updateTypeMap
to write the default values into the record .. (this may make sense when
using DataModel with SQL+Schema, where default values are in DB.
For the LDAPModel this does not really make sense, because there is no
default-value definiton possible for schemas.)

The question is, which attribute need to be set to
which default-value ... the attribute-names can be taken from loadAttrs
of RecordType or from the Schema-Definition. but if i set them all to
e.g. [] the feature.defaultValue of an Element's feature will never be
used. should i set the attributes to [] as default at all,
or should basically a feature use 
_fData.setdefault(key,feature.defaultValue)
 to access the values ???

thanks for any hints ...

Ulrich Eck
---------------------------------------------------------------------------
net-labs Systemhaus GmbH
Ebersberger Str. 46
85570 Markt Schwaben
fon:   +49-8121-4747-11
fax:   +49-8121-4747-77
email: ueck at net-labs.de
http://www.net-labs.de



More information about the PEAK mailing list