[Zope] Volatile variables Problem
Antonio Beamud Montero
antonio.beamud@agora-2000.com
05 Feb 2003 16:42:19 +0100
Opsss, temp_folder is the solution more closest that I already have...=20
I suppose I can create a temp_folder in my product and store in this
folder a object that contains this variables.
I'm going to check this solution...
A lot of thanks
El mi=E9, 05-02-2003 a las 15:50, Casey Duncan escribi=F3:
> On Wednesday 05 February 2003 09:15 am, Oliver Bleutgen wrote:
> > Antonio Beamud Montero wrote:
> > > Hi all:
> > > Well, i have a serious problem... I have defined a variable inside my
> > > product that I refresh periodically via XML-RPC (every ~1 min). I nee=
d
> > > to maintain this variable volatile because ZODB grows to the infinite=
...
> > > The problem arises when a new conection is established an the variabl=
e
> > > value need to be shown. In some cases the query raises an
> > > AttributeException. Now I catch this exception, but this no solves my
> > > problem...=20
> > > Why the value of this variable is lost?
> >=20
> >=20
> > Since nobody responded till now, here are my 5c.
> > Volatile attributes are only guaranted to exist as long a transaction=20
> > AFAIK, OTOH they are also not guaranted to _not_ exist longer, which=20
> > might explain that you don't see this failure everytime.
>=20
> Volatiles (_v_ variables) are thread-specific. A request handled by one t=
hread=20
> won't see volatiles created on another thread.
> =20
> > So, I fear volatile attributes can't help you here.
> >=20
> > > How I can solve the problem?
> >=20
> > Hmm, an external method which stores the values in a file? A external=20
> > database? The sessioning stuff?
> >=20
> > Sorry, I have no really good idea there, maybe it helps if you explain=20
> > what you want to do in more detail ...
>=20
> You can use sessions, but they are user-specific. If it needs to be globa=
l to=20
> all users, create a persistent class and store an instance in the temp_fo=
lder=20
> (which is where the seesion data is stored). That is a volatile storage=20
> shared between all threads. It will only be lost if Zope restarts.
>=20
> hth,
>=20
> -Casey
--=20
Microsoft merges technologies:=20
Windows CE + Windows ME + Windows NT =3D Windows CEMENT
----
Antonio Beamud Montero
Agora Systems S.A.
http://www.agoratechnologies.com