• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stateless EJBs behaviour  RSS feed

 
priya Anand
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Could anybody let me know, if in case of a bean managed stateless EJB, where no user transaction is created,
is it possible that the stateless EJB is returned to pool even without completing the method that it is executing?

Any help is appreciated.

- Priya
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, the EJB won't be returned to the pool until the method is completed.

Is there an error that you're seeing that indicates that you're not getting this expected behavior?

-Cameron McKenzie
 
priya Anand
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi cameron,

Thanks for the reply. Yes I do see that sometimes the instance variables in my EJB gets reset, or has information, not pertaining to the client in case there are multiple users logged into the application.

Could you tell me as to why this might be happening?

Thanks and Regards,
Priya Anand
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if we're talking about stateless EJBs, we shouldn't see any instance variables or state like behavior in them, right? So, if there is client based state being lost or bungled up, it would likely be somewhere other than the stateless bean.

-Cameron McKenzie
 
priya Anand
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey cameron,

Sorry for the late reply, but could you throw some light, on where else may the data be getting lost?

This is a typical example in my stateless EJB,

debugger.printMap("************OUTPUT of "+strRequest+"********"+strOrderKey+"*********\n");
debugger.printMap(mapOutput);
debugger.printMap("*****************************\n");

if(this.mapOutput.containsKey("OrderHeader")){}

I get the map printed here, I also see OrderHeader there but it never enters the if statement below, this is a random behaviour. Does not happen always.


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!