I'm using Ramon Leon's MagritteGlorp package, which ties together the
extremely useful Magritte and Glorp packages, but must not be using
it quite correctly. When registering an object that has a reference
to an already stored object, it seems to attempt re-insert the
referenced object. For example:
objA := ADescriptorSystem getSession execute: (A find where [:ea | ea
name = 'hello']).
objB := B new.
objB a: objA.
session := B getSession.
session beginUnitOfWork.
objB register: objB.
session commitUnitOfWork.
raises a 'GlorpDatabaseWriteError: ERROR: duplicate key violates
unique constraint' error. I thought it might be because I am using
one session to load the object and another session to register, but
believe I've also tried doing everything in one session. If it is of
any help, the reference description is of type
MAToOneRelationDescription. On another project, I tried
MAMultipleOptionDescription with the same error. Any ideas on how to
make it recognize the object is already stored and hasn't changed?
Thanks, Brian.
Glorp.rjl.8
GlorpPostload-rjl.3
GlorpPreload-rjl.2
Magritte-Seaside-lr.228.mcz
Magritte-Model-lr.266
MagritteGlorp-rjl.47