[Ooc-checkins] libpobj/src PObj.Mod,1.29,1.30
Brought to you by:
mva
From: Michael v. A. <mv...@us...> - 2005-01-08 09:18:45
|
Update of /cvsroot/ooc/libpobj/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4555/src Modified Files: PObj.Mod Log Message: add experimental switch "referential integrity for new objects" Index: PObj.Mod =================================================================== RCS file: /cvsroot/ooc/libpobj/src/PObj.Mod,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- PObj.Mod 18 Dec 2004 19:58:15 -0000 1.29 +++ PObj.Mod 8 Jan 2005 09:18:35 -0000 1.30 @@ -75,6 +75,7 @@ ContainerDesc* = RECORD [ABSTRACT] connection-: DBI.Connection; log-: Logger.Handle; + referentialIntegrityForNewObjects-: BOOLEAN; cache: ObjectCache; insertList, deleteList, dirtyObjects: ObjectList; classDict: ClassDictionary; @@ -458,7 +459,9 @@ id := cnt.InsertObject(obj); obj.id := id; obj.SetState(internalized); - cnt.cache.Set(Key(obj.Class(), id), obj); + IF cnt.referentialIntegrityForNewObjects THEN + cnt.cache.Set(Key(obj.Class(), id), obj); + END; | internalized: (* nothing to do *) @@ -1505,6 +1508,7 @@ BEGIN cnt.connection := conn; cnt.log := Logger.nullHandle; + cnt.referentialIntegrityForNewObjects := TRUE; cnt.cache := NEW(ObjectCache); cnt.insertList := NEW(ObjectList, 32); cnt.deleteList := NEW(ObjectList, 32); @@ -1517,6 +1521,11 @@ cnt.log := lh; END SetLogHandle; +PROCEDURE (cnt: Container) SetReferentialIntegrityForNewObjects*(referentialIntegrityForNewObjects: BOOLEAN); + BEGIN + cnt.referentialIntegrityForNewObjects := referentialIntegrityForNewObjects; + END SetReferentialIntegrityForNewObjects; + PROCEDURE (cnt: Container) RegisterClass*(class: MetaData.Class); BEGIN cnt.classDict.Set(class.name, class); |