You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Henning P. Schmiedehausen" <ma...@hometree.net> on 2001/05/16 16:39:47 UTC
RunData Object
Hi,
is it legal to keep a private reference to the RunData object handled
down from the Turbine into an action method and reuse it?
In my concrete case, I have access to a RunData object at object
creation time and currently I keep a copy of this object in a private
variable in the new object, because I need it in some other methods of
the object (namely for TableLinks) where I have no access to a RunData
object.
Must I be prepared, that I could get another object everytime one of my
methods is called by Turbine or will I always get the same object?
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH hps@intermeta.de
Am Schwabachgrund 22 Fon.: 09131 / 50654-0 info@intermeta.de
D-91054 Buckenhof Fax.: 09131 / 50654-20
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: RunData Object
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Jon Stevens <jo...@latchkey.com> writes:
> on 5/16/01 9:18 AM, "Leandro Saad" <le...@ibnetwork.com.br> wrote:
>
> > I'm afraid not
> > I was trying to implement something like the Memento design pattern
> > holding a reference
> > to RunData but, as RunData objects are cached, I was holding a reference
> > to an object that
> > was going to be used at another request.
>
> Bad bad bad bad idea.
>
> *NEVER* hang on to a RunData.
You can think of hanging onto a RunData as analogous to hanging onto a
HttpServletRequest and HttpServletResponse, only worse. ;)
Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: RunData Object
Posted by Jon Stevens <jo...@latchkey.com>.
on 5/16/01 9:18 AM, "Leandro Saad" <le...@ibnetwork.com.br> wrote:
> I'm afraid not
> I was trying to implement something like the Memento design pattern
> holding a reference
> to RunData but, as RunData objects are cached, I was holding a reference
> to an object that
> was going to be used at another request.
Bad bad bad bad idea.
*NEVER* hang on to a RunData.
-jon
--
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: RunData Object
Posted by Leandro Saad <le...@ibnetwork.com.br>.
"Henning P. Schmiedehausen" wrote:
>
> Hi,
>
> is it legal to keep a private reference to the RunData object handled
> down from the Turbine into an action method and reuse it?
I'm afraid not
I was trying to implement something like the Memento design pattern
holding a reference
to RunData but, as RunData objects are cached, I was holding a reference
to an object that
was going to be used at another request.
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: RunData Object
Posted by Jon Stevens <jo...@latchkey.com>.
on 5/16/01 7:39 AM, "Henning P. Schmiedehausen" <ma...@hometree.net>
wrote:
> Hi,
>
> is it legal to keep a private reference to the RunData object handled
> down from the Turbine into an action method and reuse it?
>
> In my concrete case, I have access to a RunData object at object
> creation time and currently I keep a copy of this object in a private
> variable in the new object, because I need it in some other methods of
> the object (namely for TableLinks) where I have no access to a RunData
> object.
>
> Must I be prepared, that I could get another object everytime one of my
> methods is called by Turbine or will I always get the same object?
>
> Regards
> Henning
All of your "Modules" must be thread safe.
RunData should *never* be kept longer than the life of one "access" to the
system.
-jon
--
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org