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.

117 questions
0
votes
1 answer

Stateful bean doesn't keep state

I have a stateful bean: @Stateful public class ClientContext { private Band band; public Band getBand() { return band; } public void setBand(Band band) { this.band = band; } } I have Arquillian test. public…
Alex Kartishev
  • 1,766
  • 2
  • 17
  • 25
0
votes
1 answer

RequestedScopre ManagedBean VS Stateful Bean

How to choose which implementation of UserDao class? One is a stateful session EJB, and the other one is a manged session bean with RequestedScope annotation. The code of the stateful session seems much simpler. In this user greeter case, both…
marlon
  • 2,197
  • 3
  • 19
  • 33
0
votes
1 answer

javaee statefull bean not working

I've defined an @Stateful @StatefulTimeout(value = 2, unit = TimeUnit.HOURS) rest bean so that it can hold a private MyContext userContext; (basically a List holding all previous values passed to the rest bean). I've launched my webapp in a…
Cerber
  • 2,649
  • 3
  • 23
  • 40
0
votes
1 answer

Stateful sessions Beans CMT

Good afternoon in my timezone. I am preparing to the EJB 3.0 certification exam and i reading the "EJB3 In Action" book. In the Pros and Cons of using BMT transaction type section , it says that "if you are using a stateful session bean and need to…
tt0686
  • 1,607
  • 5
  • 26
  • 48
0
votes
1 answer

Displaying stateful session bean values on JSP

I have used DI to inject a Stateful Session Bean across 3 servlets (which take data from forms across 3 JSP pages), so that data received by all 3 servlets can be stored in it. When I print all the data of the Bean in the last servlet, it gets…
0
votes
1 answer

Migrating stateful session bean from EJB 2.1 to EJB 3 - how to migrate create method having args

Im trying to migrate a stateful session bean from EJB 2.1 to EJB 3.0, the home interface of the bean which extends EJBHome has a create method with two args and the corresponding bean has a matching args ejbcreate method and one more no arg…
ajith
  • 5
  • 2
0
votes
1 answer

EJB Bean is associated with a different unfinished transaction

Please look at this snippet: @Stateless public class A { @EJB B b; // B is stateful EJB b.init(); // initialize Sets and List that are used in doSthInB(C c) public void doSthInA(){ for(C c){ b.doSthInB(c); //…
0
votes
2 answers

Encapsulating stateless beans inside a stateful session

I have a Java EE application using EJBs, and perform most of the functions through Stateless EJBs. I have a requirement for all users to also have an active session, and I'm wondering what the best way of using the beans are. Currently, I have a…
0
votes
2 answers

Container managed transaction boundary in SFSB

I have read in the book that: Typically, the container begins a transaction immediately before an enterprise bean method starts. It commits the transaction just before the method exits. Suppose my stateful EJB has exposed 3 business methods and…
user2306993
  • 185
  • 1
  • 11
0
votes
0 answers

Stateful session bean created each time

I have a stateful session bean that initializes a Collections.synchronizedList, I add products to the list and check the list, it works(all during the same session). But when I restart the browser it doesn't show me the list. After watching the…
Antonio Foglia
  • 77
  • 1
  • 10
0
votes
1 answer

Stateful Session Bean lifecycle

I have a "stateful session bean" that initializes a synchronizedList,i add products to the list and check the list, it works(all during the same session). Is it normal that when I do the "undeploy" of my application and then make another"deploy" I…
Antonio Foglia
  • 77
  • 1
  • 10
0
votes
2 answers

Stateful session bean doesnt work in production - NoSuchObjectLocalException

I have a problem with deployed Java web application containing one Stateful session bean. Everything works fine until I try to invoke this bean. I get an exception: javax.ejb.NoSuchObjectLocalException: The EJB does not exist. session-key:…
Macejkou
  • 556
  • 3
  • 13
  • 23
0
votes
0 answers

Set value in Stateful EJB

I want to start using the Stateful EJB to keep logged user's info, I have the following EJB: @Stateful public class CurrentUserBean { private User currentU; @PostConstruct public void init(){ System.out.println("Init CU EJB"); …
0
votes
2 answers

stateful bean behaving like a stateless bean

I'm new to EJB and try to write a implementation for EJB stateful bean but when I try to do the transaction its returning like a stateless bean package beanpackage; import javax.ejb.Stateful; //import javax.ejb.Stateless; /** * Session Bean…
0
votes
1 answer

Where is the "create" method in stateful session bean Java EE 6

When I see the example about Stateful Session Bean Java EE 6, I never see the create method, here is the interface: public interface Cart { public void initialize(String person) throws BookException; public void initialize(String person, String…
MasterDark116
  • 88
  • 1
  • 1
  • 4