• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Stateless Session Bean Problems Singleton  RSS feed

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Every one,
We have a caching service which uses a JBoss Tree Cache class, its like we can put and get object out the cache. We wanted remote users to use this service so we added a state less bean in front of the Caching Tree Class, The state of the Tree Cache class is taken care by Spring Core so which defaults to singleton , so clients get a hold of Tree using a session bean (stateless) call put an object, we can do all the operations on cache like put and get with in a single session bean call but when we put an object in one call and try to retrieve it in another I get a null. I know that stateless session beans are there to forget the state, but if it interfaces a class object whose state is maintained by spring and defaults to singleton there should be no problem, but when we run some test cases it wont work, it works fine in one session bean call, but when I put and get an object in two different calls it fails and I get a null value. Hope I was able to explain the design here, the main question after this would be how can we get a stateless session bean to get hold of a bean which is singleton? In multiple calls.

Any help would be appreciated.
Thanks in advance.
Regards
 
ranger
Posts: 17344
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Seshu",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with display names get deleted.

Thanks

Mark
 
Hold that thought. Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!