RE: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Martin Gainty

Hi Chris-

did you run the testContextReferences() and testArithmentocs from 
org.apache.struts2.uel.PerformanceTest for 1000 JEUL testcase iteration?
here is what i have:

Running org.apache.struts2.uel.PerformanceTest
Eval: [#obj.age + #obj2.age] on 100 iterations
OGNL: 4547 ms
JUEL: 9750 ms
Eval: [#x + #y * #z] on 100 iterations
OGNL: 1516 ms
JUEL: 5234 ms

did you get these results?
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Sat, 21 Nov 2009 16:53:33 -0800
> Subject: Re: (clearly O/T) use of ThreadLocal vs Synchronized
> From: thechrispr...@gmail.com
> To: user@struts.apache.org
> 
> Unfortunately the same cannot be said for OGNL.  I spent most of Friday
> going through the interwebs archives and finding out that one major sticking
> point in my architecture (and all of yours) is that OGNL synchronizes just
> about everything.  I spent about 6 hours going through the code and removing
> some of the offending blocks.  I'm hoping that Musachy's latest attempt at
> removing OGNL all together will end up being the ultimate solution, but only
> time will tell.
>   (*Chris*)
> 
> On Sat, Nov 21, 2009 at 4:48 PM, Martin Gainty  wrote:
> 
> >
> > so
> > shared variable-use synchronized
> > not-shared variable-use threadLocal
> >
> > struts code has only a few synchronized blocks or synchronized methods
> > but plenty of ThreadLocal specifically the all important Dispatcher
> > instance
> > private static ThreadLocal instance = new
> > ThreadLocal();
> >
> > thanks chris
> > Martin Gainty
> > __
> > Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> >
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> > dient lediglich dem Austausch von Informationen und entfaltet keine
> > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> > destinataire prévu, nous te demandons avec bonté que pour satisfaire
> > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> > de ceci est interdite. Ce message sert à l'information seulement et n'aura
> > pas n'importe quel effet légalement obligatoire. Étant donné que les email
> > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> > aucune responsabilité pour le contenu fourni.
> >
> >
> >
> >
> > > To: user@struts.apache.org
> > > Subject: Re: (clearly O/T) use of ThreadLocal vs Synchronized
> > > Date: Sat, 21 Nov 2009 19:27:16 -0500
> > > From: musom...@aol.com
> > >
> > >
> > >  They are quite distinct -- ThreadLocal variables are not shared at all
> > while synchronized permits sharing (but not concurrently).
> > > Suppose you have a background thread that does some calculation that you
> > might need [in my case you have an abstract
> > > graph and a background thread is checking if the graph has intersecting
> > edges so that algorithms that need to know can
> > > use a cached answer rather than calculate it at the time they need it].
> > You can't use a thread local because you want the
> > > background thread to play with the very same variable but still not get
> > in the way of the main thread of the algorithm.
> > >
> > >
> > >
> > > Chris
> > >
> > >
> > >
> > >
> > > -Original Message-
> > > From: Martin Gainty 
> > > To: Struts Users Mailing List 
> > > Sent: Sat, Nov 21, 2009 8:38 am
> > > Subject: (clearly O/T) use of ThreadLocal vs Synchronized
> > >
> > >
> > >
> > > Good Morning All-
> > >
> > > are there any instances where a factory use of synchronized keyword is
> > preferred
> > > or considered more efficient implementation over creating a ThreadLocal
> > object?
> > >
> > http:/

Re: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Chris Pratt
Unfortunately the same cannot be said for OGNL.  I spent most of Friday
going through the interwebs archives and finding out that one major sticking
point in my architecture (and all of yours) is that OGNL synchronizes just
about everything.  I spent about 6 hours going through the code and removing
some of the offending blocks.  I'm hoping that Musachy's latest attempt at
removing OGNL all together will end up being the ultimate solution, but only
time will tell.
  (*Chris*)

On Sat, Nov 21, 2009 at 4:48 PM, Martin Gainty  wrote:

>
> so
> shared variable-use synchronized
> not-shared variable-use threadLocal
>
> struts code has only a few synchronized blocks or synchronized methods
> but plenty of ThreadLocal specifically the all important Dispatcher
> instance
> private static ThreadLocal instance = new
> ThreadLocal();
>
> thanks chris
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > To: user@struts.apache.org
> > Subject: Re: (clearly O/T) use of ThreadLocal vs Synchronized
> > Date: Sat, 21 Nov 2009 19:27:16 -0500
> > From: musom...@aol.com
> >
> >
> >  They are quite distinct -- ThreadLocal variables are not shared at all
> while synchronized permits sharing (but not concurrently).
> > Suppose you have a background thread that does some calculation that you
> might need [in my case you have an abstract
> > graph and a background thread is checking if the graph has intersecting
> edges so that algorithms that need to know can
> > use a cached answer rather than calculate it at the time they need it].
> You can't use a thread local because you want the
> > background thread to play with the very same variable but still not get
> in the way of the main thread of the algorithm.
> >
> >
> >
> > Chris
> >
> >
> >
> >
> > -Original Message-
> > From: Martin Gainty 
> > To: Struts Users Mailing List 
> > Sent: Sat, Nov 21, 2009 8:38 am
> > Subject: (clearly O/T) use of ThreadLocal vs Synchronized
> >
> >
> >
> > Good Morning All-
> >
> > are there any instances where a factory use of synchronized keyword is
> preferred
> > or considered more efficient implementation over creating a ThreadLocal
> object?
> >
> http://www.javamex.com/tutorials/synchronization_concurrency_thread_local2.shtml
> >
> > any answers are appreciated!
> > Martin Gainty
> > __
> > Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> >
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger
> > sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung
> > oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient
> lediglich dem
> > Austausch von Informationen und entfaltet keine rechtliche
> Bindungswirkung.
> > Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine
> Haftung
> > fuer den Inhalt uebernehmen.
> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas
> le
> > destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez
> > l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de
> ceci est
> > interdite. Ce message sert à l'information seulement et n'aura pas
> n'importe
> > quel effet légalement obligatoire. Étant donné que les email peuvent
> facilement
> > être sujets à la manipulation, nous ne pouvons accepter aucune
> responsabilité
> > pour le contenu fourni.
> >
> >
> >
> > _
> > Bing brings you maps, menus, and reviews organized in one place.
> >
> http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1=
> >
> >
>
> _
> Bing brings you maps, menus, and reviews organized in one place.
>
> http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1
>


RE: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Martin Gainty

so 
shared variable-use synchronized
not-shared variable-use threadLocal

struts code has only a few synchronized blocks or synchronized methods
but plenty of ThreadLocal specifically the all important Dispatcher 
instance
private static ThreadLocal instance = new ThreadLocal();

thanks chris
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> To: user@struts.apache.org
> Subject: Re: (clearly O/T) use of ThreadLocal vs Synchronized
> Date: Sat, 21 Nov 2009 19:27:16 -0500
> From: musom...@aol.com
> 
> 
>  They are quite distinct -- ThreadLocal variables are not shared at all while 
> synchronized permits sharing (but not concurrently).
> Suppose you have a background thread that does some calculation that you 
> might need [in my case you have an abstract
> graph and a background thread is checking if the graph has intersecting edges 
> so that algorithms that need to know can
> use a cached answer rather than calculate it at the time they need it]. You 
> can't use a thread local because you want the 
> background thread to play with the very same variable but still not get in 
> the way of the main thread of the algorithm.
> 
>  
> 
> Chris
>  
> 
>  
> 
> -Original Message-
> From: Martin Gainty 
> To: Struts Users Mailing List 
> Sent: Sat, Nov 21, 2009 8:38 am
> Subject: (clearly O/T) use of ThreadLocal vs Synchronized
> 
> 
> 
> Good Morning All-
> 
> are there any instances where a factory use of synchronized keyword is 
> preferred 
> or considered more efficient implementation over creating a ThreadLocal 
> object?
> http://www.javamex.com/tutorials/synchronization_concurrency_thread_local2.shtml
> 
> any answers are appreciated!
> Martin Gainty 
> __ 
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>  
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem 
> Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
> Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
> fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est 
> interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
> quel effet légalement obligatoire. Étant donné que les email peuvent 
> facilement 
> être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
> pour le contenu fourni.
> 
> 
>   
> _
> Bing brings you maps, menus, and reviews organized in one place.
> http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1=
> 
>  
  
_
Bing brings you maps, menus, and reviews organized in one place.
http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1

Re: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread musomesa

 They are quite distinct -- ThreadLocal variables are not shared at all while 
synchronized permits sharing (but not concurrently).
Suppose you have a background thread that does some calculation that you might 
need [in my case you have an abstract
graph and a background thread is checking if the graph has intersecting edges 
so that algorithms that need to know can
use a cached answer rather than calculate it at the time they need it]. You 
can't use a thread local because you want the 
background thread to play with the very same variable but still not get in the 
way of the main thread of the algorithm.

 

Chris
 

 

-Original Message-
From: Martin Gainty 
To: Struts Users Mailing List 
Sent: Sat, Nov 21, 2009 8:38 am
Subject: (clearly O/T) use of ThreadLocal vs Synchronized



Good Morning All-

are there any instances where a factory use of synchronized keyword is 
preferred 
or considered more efficient implementation over creating a ThreadLocal object?
http://www.javamex.com/tutorials/synchronization_concurrency_thread_local2.shtml

any answers are appreciated!
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.


  
_
Bing brings you maps, menus, and reviews organized in one place.
http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1=

 


RE: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Martin Gainty

Buona-sera Antonio

ga is nice but i've heard italy has more sunny days

is this true?
Martin 
__ 
Prego non alteri/modifichi o interrompa questa trasmissione..grazie




> Date: Sat, 21 Nov 2009 22:07:43 +0100
> Subject: Re: (clearly O/T) use of ThreadLocal vs Synchronized
> From: antonio.petre...@gmail.com
> To: user@struts.apache.org
> 
> 2009/11/21 Martin Gainty :
> >
> >  yes in all probability still at
> >
> >
> > pingback when you posted pics of "sunny and dry ga" when you get a chance
> 
> Really? I like sun and dry ga. Do you like them?
> 
> Antonio
> 
> P.S.: I'm not mad, just curious...
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  
_
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/

Re: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Antonio Petrelli
2009/11/21 Martin Gainty :
>
>  yes in all probability still at
>
>
> pingback when you posted pics of "sunny and dry ga" when you get a chance

Really? I like sun and dry ga. Do you like them?

Antonio

P.S.: I'm not mad, just curious...

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Martin Gainty

 yes in all probability still at


pingback when you posted pics of "sunny and dry ga" when you get a chance

interesting graphic btw
 Martin Gainty 
__ 
WARNING: Material contained within this transmission has been deemed "not 
suitable" for liberal arts or business majors




> Date: Sat, 21 Nov 2009 13:22:07 -0500
> From: d...@newfield.org
> To: user@struts.apache.org
> Subject: Re: (clearly O/T) use of ThreadLocal vs Synchronized
> 
> I think that Martin is a turing test...and I'm beginning to feel that he 
> might indeed be human...which can only mean the AIs are winning.  Can 
> Skynet be far behind?
> 
> ObXKCD: http://xkcd.com/329/
> 
> -Dale
> 
> P.S.:  Even more clearly O/T.
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  
_
Windows 7: It works the way you want. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009v2

Re: (clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Dale Newfield
I think that Martin is a turing test...and I'm beginning to feel that he 
might indeed be human...which can only mean the AIs are winning.  Can 
Skynet be far behind?


ObXKCD: http://xkcd.com/329/

-Dale

P.S.:  Even more clearly O/T.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



(clearly O/T) use of ThreadLocal vs Synchronized

2009-11-21 Thread Martin Gainty

Good Morning All-

are there any instances where a factory use of synchronized keyword is 
preferred or considered more efficient implementation over creating a 
ThreadLocal object?
http://www.javamex.com/tutorials/synchronization_concurrency_thread_local2.shtml

any answers are appreciated!
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.


  
_
Bing brings you maps, menus, and reviews organized in one place.
http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1

Re: Strange behavior after upgrade

2009-11-21 Thread test mail
Dear frnd,

 I have never used strut 2 but if your using hibernate then
u r supposed to flush your session to update your database.


Regards
D'Souza


On Fri, Nov 20, 2009 at 5:13 AM, Thomas Sattler wrote:

> Hello all.
>
> I have upgraded a Struts 2.0.11 project to 2.1.8, and I have some strange
> behavior.  The Struts stuff seems to work fine, and the Ajax stuff works
> fine as well.  The Hibernate stuff works as far as reading data is
> concerned.  But when I try to write a record, nothing happens on the
> database and I get no exception thrown, and I get no errors in the log.
>
> For instance, whenever a user logs in, a LoginHistory object is created,
> and
> subsequently written to the login_history table in Postgres.  The
> application is using the EntityManager to persist a new object.  The code
> is
> simple; the LoginHistoryService class says:
>
>
>public void persist(LoginHistory loginHistory)
>{try {
>System.out.println("About to insert login_history record") ;
>entityManager.persist(loginHistory);
>System.out.println("Done inserting login_history record") ;
>}
>catch (Exception ex)
>{
>System.out.println(ex.getMessage() ) ;
>}
> }
>
> I see the two logged messages, and in stepping through with a debugger, the
> persist statement *seems* to be done, but nothing appears in the database.
>
> Also, when changing a User's account data, nothing winds up in Postgres.
> The UserService class says:
>
>
>public void merge(User user)
>{   try {
>entityManager.merge(user);
>}
>catch (Exception ex)
>{
>System.out.println(ex.getMessage() ) ;
>}
>}
>
> But the record is never changed.
>
>
> The Hibernate section of pom.xml says:
>
>
> org.hibernate
> hibernate
>3.2.1.ga
>
>
>
> org.hibernate
> hibernate-annotations
> 3.2.1.ga
>
>
>
> org.hibernate
> hibernate-entitymanager
> 3.2.1.ga
>
>
>
> As I sit here pulling my hair out, does anyone remember having anything
> like
> this happen after an upgrade to 2.1.8?  Or an any other circumstance?
>
> Thanks,
> Tom
>