File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Stateless Session Bean  Problems Singleton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Stateless Session Bean  Problems Singleton" Watch "Stateless Session Bean  Problems Singleton" New topic

Stateless Session Bean Problems Singleton

seshu Palamanti
Ranch Hand

Joined: Jul 03, 2004
Posts: 63
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.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

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.



Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Stateless Session Bean Problems Singleton
It's not a secret anymore!