[Zope] Technical Question - Where the Session Data Stored ?

Jonathan Hobbs toolkit at magma.ca
Fri Sep 17 07:30:31 EDT 2004


----- Original Message -----
From: "kepes.krisztian" <kepes.krisztian at peto.hu>
> My problem is that: I need to persistent store many form datas, because
> I need to create multiple edit forms.
>
> They are multiple forms, because the first is open the next, but in same
> browser window, and when the second form opened, the first form is not
> saved to database, only stored in persistent store.
> And when the second form is closed by submit, the first form is showed,
> and the first form's data is get from persistent store, not from database.
>
> So it is usable for multiple edits. I don't want use popup windows for
> this operation, popups are blocked in many machine.
>
> I write this mechanism yesterday.
> The first form is load the datas from outer database.
> The first form's one button is store the first form's request to the
> session with a special ID.
> The second form is opened, and the special ID is stored.
> When the second form is submitted (ok, or cancel), the second form is
> store the result in session[special ID]['result'], and redirected to
> first form with the special ID.
> First form is see the special ID, and it is determine, that datas are
> not get from database, they are get from session[special ID], and
> session[special ID]['result'].
>
> When the first form is saved (apply or ok), this state is saving to the
> database, and next the datas are loaded from the database.
>
> So:
> Because I save the states to session, all of them are stored with unique
> (new) key. While session is living, this parameters are not released,
> because I don't know, when they are used (example: open a page in
> multiple browser windows, and when the first is saved, the second is
> hold same special ID).
>
> The technical question: where the session data stored ?
> Because it is memory, it is cause memory leak. When in file, it is not
> problem.
>
> So the question is: session is good for persistent data storing with
> multiple forms, or I need to create an outer database table for these
> operations ?

Session data is stored in a 'Transient Object Container' which (in the
default zope installation) is located in 'temp_folder' in the root
directory.  This information will persist only as long as the 'data object
timeout value'.  I would not recommend using this to store data that you
want to be 'persistent'.

Jonathan




More information about the Zope mailing list