[Glass] how to update models properly
Dale Henrichs via Glass
glass at lists.gemtalksystems.com
Thu Oct 30 12:07:20 PDT 2014
If you are using the oop of an object as an id that is shared with other
systems you have to take some care:
- the oop is tied to the identity of the object so as long as the object
is alive the oop
- holding onto an oop does not count as a reference for garbage
so the object can be gc'ed while the remote reference is being held
If this is an issue you can arrange to have an "export set" where you
can put the objects
while they are being referenced...of course you now have the issue of
in your export set ...
- when an object is gc'ed the oop itself will possibly be reused for
another object ... so if your
"export set" leaks you may end up with entirely different objects
showing up in unexpected
- temporary objects may be assigned oops and assigning an oop does not
make the object
persistent. Other vms in the system will not be able to access the
temporary objects in
another vm (unless the temp object is made persistent by reference from
a root object
and committed). The vm level gc may also collect your temp object, so if
you are using
the oops of temp objects, you almost certainly have to use an "export
set" to keep them
Depending upon your application you may not need to worry about some of
these issues, but using oops as ids for external systems is awfully
convenient so you need to pay close attention to what you are doing with
On Thu, Oct 30, 2014 at 11:45 AM, BrunoBB via Glass <
glass at lists.gemtalksystems.com> wrote:
> > The extreme case would be to use the OOP/OID from GemStone as the unique
> > ID
> I have a similar case in my application. Some GemStone object are updated
> from a Relational Database (MySQL).
> * Once an Object has an OOP it will remain the same until the Object is
> garbage collected ?
> * Or the OOP of an object can change during it's life time ?
> In my app each Relational Row is mapped to a Dictionary, and the Object it
> self is never changed but it's instance variables are constantly updated
> with relational data.
> If i use the OOP as way to map object with external system we MUST be sure
> that the OPP is allways the same...
> View this message in context:
> Sent from the GLASS mailing list archive at Nabble.com.
> Glass mailing list
> Glass at lists.gemtalksystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glass