This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Changes made in JNDI by servlet not seen in EJB  RSS feed

Ondrej Babuljak
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!