Questions tagged [stateful-session-bean]

A stateful session bean is an enterprise bean (EJB component) that acts as a server-side extension of the client that uses it. The stateful session bean is created by a client and will work for only that client until the client connection is dropped or the bean is explicitly removed.

A stateful session bean is an enterprise bean (EJB component) that acts as a server-side extension of the client that uses it. The stateful session bean is created by a client and will work for only that client until the client connection is dropped or the bean is explicitly removed.

119 questions
0
votes
0 answers

InitialContext.lookup("path") throws javax.naming.NamingException

I am new to java and learning how to implement stateful ejb, I couldn't do that- (I wanted to maintain a list by adding and removing element in a arrayList) and unit testing is working fine, initializing the object throws the…
Veshraj Joshi
  • 3,544
  • 3
  • 27
  • 45
0
votes
1 answer

How is state maintained within an application/web server?

I understand what stateful and stateless session beans are and when to use them but I am curious as to how an application/web server knows that this object instance belongs to this client. Is a session id sent in the form of a cookie and the…
Grim
  • 2,398
  • 4
  • 35
  • 54
0
votes
2 answers

Real world use cases for stateful session EJB

Regarding the use of session EJBs, what I have seen until now in "real world applications" (if I remeber correctly) are stateless session EJB used as "facades" for transactional (via CMT) business logic methods. I have not seen any stateful session…
John Donn
  • 1,718
  • 2
  • 19
  • 45
0
votes
0 answers

How to get one stateful session bean using another stateful session bean

I want to make one functionality i.e if user changes password from one device, he should get logout from all other devices where he was logged in. For this I will need to get all other session bean object atleast. is there any way to get all other…
nilesh
  • 1,483
  • 2
  • 19
  • 37
0
votes
1 answer

EJB session bean does not initialize properly (NameNotFoundException)

I am having trouble figuring out why an EJB session bean is not working. The actual error message is an EJBException: NameNotFoundException, but that is not a very illuminating message. I have traced it down to a exactly what line causes the…
RRP
  • 1
  • 1
0
votes
1 answer

Confused about the use of @Remote in an EAR

Using NetBeans, I have successfully run the shopping-cart example presented in the Java EE 6 tutorial on the Oracle website. It's an EAR with two modules: an EJB module and an application client module. I have cut short some details of the code in…
softwarelover
  • 1,009
  • 1
  • 10
  • 22
0
votes
1 answer

When bean=null, does the app server trash the stateful bean instance and create new one?

I know this has been asked million times, but so far it didn't answer the question in my head, I think it's best to understand in code, could someone please verify my thinking: Stateless bean in client: public void work(){ bean.work1(); <---…
James Lin
  • 25,028
  • 36
  • 133
  • 233
0
votes
1 answer

WildFly EJB UnknownSessionID

I just started learning ejb and now have problems. My ejb code is @Stateful @StatefulTimeout(value=80, unit=TimeUnit.SECONDS) public class HelloWorldBean { int i = 0; public int SayHello() { return i++; …
FoxNet
  • 518
  • 5
  • 17
0
votes
1 answer

Can I Reach Stateful Bean After Closing The Browser?

I need help about Stateless and Stateful Session Beans. I have got a few questions. Please clearly say to me what is the difference between Stateless and Stateful Session Bean? A few people say that Stateful beans keep info about client. What kind…
Ilkay Günel
  • 37
  • 1
  • 9
0
votes
0 answers

Spring Stateful Bean equivalent - synchronization callback methods

I want to migrate a Stateful Session Bean (EJB 2.1) to a Spring bean. Both the Stateful Bean and the Spring Bean shall run in Websphere Application Server using the Websphere Transaction Manager (the WebsphereUowTransactionManager interface allows…
Entomo
  • 275
  • 3
  • 12
0
votes
1 answer

Stateful session bean passivation and serialization - EJB

Following questions hits my mind 1) I read somewhere: Passivation: a stateful bean's chance at scalability What does scalability means here ? 2) How Stateless session bean more scalable then Stateful session bean ? 3) As For passivation a…
Junaid
  • 2,572
  • 6
  • 41
  • 77
0
votes
1 answer

Mapping WebService-Client-Access to @Stateful

if I understand it right a @Stateful bean saves the state. If the client does a request again it comes back to the same instance. So it's possible to save class-attributes, what's not possible in @Stateless. In an other thread here someone wrote…
Gersee
  • 806
  • 3
  • 15
  • 30
0
votes
1 answer

Getting @EJB in the context

as discussed here Display username in jsp redirected from a servlet to get the same instance of a Stateful Session Bean, i have to save it in the HttpSession related. It is working good, but in a servlet i did so: SessionCart cart = (SessionCart)…
Neo87
  • 63
  • 1
  • 11
0
votes
1 answer

@Stateful and @SessionScoped

I'm having a problem about the bean lifecycle I don't understand. I have a @SessionScoped bean in my war: @Named @SessionScoped public class UserBean implements Serializable { @Inject UserServicesLocal userServices; [...] } then a @Staseful…
moretti.fabio
  • 1,128
  • 13
  • 32
0
votes
1 answer

Working with stateful session beans (EJB)

I have recently learnt about stateful and stateless session beans in ejb. I can work along with stateless session beans without any problem (created several applications) but i am finding it hard to implement an application with a stateful session…
Chris
  • 123
  • 1
  • 1
  • 10