• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Changes made in JNDI by servlet not seen in EJB

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I guess this will be an easy question for most of you so sorry for bothering you with such a simple problem

The problem is:

In a servlet I bind a name to an object. Then I lookup the object in EJB. When I call the servlet another time I rebind the same name to another object. But when I lookup the object in the EJB again I get the object that I bound for the first time. However lookup in the servlet gives the object bound for the second time (which is the behaviour I would expect from the lookup in the EJB as well) An example is below.

This is a sample part of code from servlet (using String for illustration):


And this is a part of code from the EJB:


Calling the servlet for the first time with parameter a="Run1" will output lines:
From servlet: Run1
From ejb: Run1

Calling the servlet again with parameter a="Run2" will output lines:
From servlet: Run2
From ejb: Run1

Can anyone explain, why is the change not promoted to ejb?

Thanx a lot,
O.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic