You would only get an Application in a thread that was started from a request thread. You wouldn't start a thread for AppB from a request in AppA. The only chance of getting that cross-over would be if you started threads in AppA that were later pooled for AppB - but that would be an existing problem.
-- Jeremy Thomerson http://www.wickettraining.com On Thu, May 20, 2010 at 5:22 PM, James Carman <ja...@carmanconsulting.com>wrote: > What if someone has two applications running in the same webapp that > are handling two different customers? What if during development, > they just happen to get the correct instance of the Application object > and they think everything is working just fine. Then, in production, > they get crossed up and the thread that's supposed to be running for > customer A gets access to customer B's application and sends an email > saying "Customer B would like to thank you for your order." > > On Thu, May 20, 2010 at 6:14 PM, Jeremy Thomerson > <jer...@wickettraining.com> wrote: > > But it also don't break anything with the ITL, and it doesn't add more > > complexity. So, in that case, why should we remove the ITL? > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > > > > > On Thu, May 20, 2010 at 4:42 PM, James Carman < > ja...@carmanconsulting.com>wrote: > > > >> Starting this short-lived thread within the context of the request > >> thread is the only place where using the ITL works correctly. All the > >> other usecases (which are both more probable and more advisable) don't > >> work reliably or at all. > >> > >> On Thu, May 20, 2010 at 4:17 PM, Alex Objelean <alex.objel...@gmail.com > > > >> wrote: > >> > > >> > I do not agree... > >> > Maybe you didn't understand completely the use-case: > >> > > >> > public class MyPage extends Page { > >> > @SpringBean > >> > private MyService service; > >> > //perform a polling of long running process triggered by a button > click > >> > onClickButton() { > >> > new Thread() { > >> > run() { > >> > service.executeLongRunningProcess(); > >> > } > >> > }.start(); > >> > } > >> > } > >> > > >> > The following example won't work well if the Application is not stored > in > >> > InheritableThreadLocal. The reason why it doesn't work, as I > understand > >> > that, is because @SpringBean lookup depends on Application instance > which > >> is > >> > not accessible from within the thread. Having it stored inside of ITL > >> would > >> > solve the problem. > >> > > >> > > >> > -- > >> > View this message in context: > >> > http://apache-wicket.1842946.n4.nabble.com/vote-Release-Wicket-1-4-9-tp2222388p2225232.html > >> > Sent from the Wicket - Dev mailing list archive at Nabble.com. > >> > > >> > > >