How to make one attribute of a persistent instance transient !??!?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make one attribute of a persistent instance transient !??!?

GLASS mailing list
Is this possible ? I would like to define an attribute within instances of persistant classes, which is transient ... it should always be initialized with nil (on transaction boundaries).

Marten

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How to make one attribute of a persistent instance transient !??!?

GLASS mailing list
On Wed, Mar 24, 2021, 23:37 Marten Feldtmann via Glass <[hidden email]> wrote:
Is this possible ? I would like to define an attribute within instances of persistant classes, which is transient ... it should always be initialized with nil (on transaction boundaries).

We have a feature request for this but it's not available yet. No ETA.

We do have a #dbTransient option on a class, which means its instances persist but only with nils in the instance variables. (Kind of weird, I know.) This allows you to create a value holder whose value(s) will never persist.


One of our customers has a convention technique whereby they use e.g. #ourCommit rather than #commitTransaction and their convention allows them to enumerate the objects that will be written and "pre-flush" each. This allows classes to nil instance variables that they don't want persisted.



Marten
_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How to make one attribute of a persistent instance transient !??!?

GLASS mailing list

Richard Sargent <[hidden email]> hat am 25.03.2021 16:41 geschrieben:


On Wed, Mar 24, 2021, 23:37 Marten Feldtmann via Glass <[hidden email]> wrote:
Is this possible ? I would like to define an attribute within instances of persistant classes, which is transient ... it should always be initialized with nil (on transaction boundaries).

We have a feature request for this but it's not available yet. No ETA.

We do have a #dbTransient option on a class, which means its instances persist but only with nils in the instance variables. (Kind of weird, I know.) This allows you to create a value holder whose value(s) will never persist.
Ok, so one would assign an attribute to an instance of that class. So all attributes (within an persistent class) with the need of being nil would point to an attribute within the instance of that dbTransient cass ... well indeed this is a possible way ... and the original attribute in the persistent class gets a getter method ...

Now, I know how to use the dbTransient class ...

Marten

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass