Sergio,

I'D say you first need to define what you mean by "persistent" If all you need is to have them survive a Garbage Collection, you just need to make sure these objects are referenced by som eother objects. Depending on your use case, this can be Seaside Sessions, Global variables (probably the worst idea), TestCase subclasses or even a TestResource.

If you want to persist them for longer, we are talking about storage of objects, which is another beast. What comes to mind are options like Fuel, STON, Json, Voyage/Mongo or Glorp with some Database - the choices are endless.

Joachim


Am 15.01.15 um 08:32 schrieb p...@highoctane.be:
On Thu, Jan 15, 2015 at 6:06 AM, sergio_101 <sergio....@gmail.com <mailto:sergio....@gmail.com>> wrote:

    I am building a seaside application, and am in the process of
    building my models and unit tests.

    I have a few objects that build up my data by creating objects.

    when i run the data creation methods, everything is fine.
    immediately afterward, since these objects to belong to anything,
    they are cleaned up by garbage collection.

    is there a way to create these objects so that they persist?



They should belong to your session if you want them to live for the session.

Otherwise, I guess you can put them in a global var to make it available everywhere, or in

GRObject>>|application|, |session|, or requestContext depending on how long you want them to live.

    if this is possible, how would you go about deleting such a
    tenacious object?


Session expiry for session vars. The other ones, standard Smalltalk way, replacing the reference with something else innocuous if you can't get rid of them the normal gc way.

Like, x become: String new. (and not x become: nil, which would make nil become x...)


    thanks!




|
|
|
|






--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:jtuc...@objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1

Reply via email to