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
2
votes
3 answers

How to access EJB from a Quartz Job

Well, I'm using Quartz to schedule some jobs that I need in my application. But, I need some way to access a Stateful SessionBean on my Job. I knew that I can't inject it with @EJB. Can anyone help me? Thanks.
Fernando Camargo
  • 2,885
  • 3
  • 28
  • 46
2
votes
1 answer

Invoke transactional method within the same SFSB

Is it possible to invoke a transactional method from within a Stateful EJB itself? To speak more clearly: @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) @Stateless public class MyService { @Resource SessionContext ctx; …
2
votes
1 answer

Stateful Session Beans don't get default values after deserialization

I was going through an EJB 3.1 book (O'Reilly, Andrew Lee Rubinger and Bill Burke), there the author is mentioning that (these are not the exact words in the book, this is my own understanding of the text): in SFSB when its becoming activated…
Jayr Motta
  • 648
  • 1
  • 6
  • 25
2
votes
3 answers

EJB3 how to make sure things happen before a bean get deleted

Suppose I let my customer reserve seats on a plane using Stateful Session Bean. If the client explicitly calls my Remove method, all of his reservations will be cancelled and the bean is removed afterward. However, in case the client is idle for…
Mr.J4mes
  • 8,680
  • 8
  • 42
  • 79
2
votes
1 answer

How to split SFSB Facade?

I am having some problems devoloping an application based on EJB 3 technology. I would like to use a Facade Pattern in the Session beans to decouple my client (a web application) from my Entity Beans. I am using a SFSB to manage the user session. So…
2
votes
1 answer

How EJB 3.X Stateful session bean maintains state?

I am kind of new to EJB. I have understanding how HTTPSession is maintained (all cookies funda). All the resource in the internet says " Stateful Session Bean Maintenance session(remembers client). But I could not find answer to How Stateful…
Malatesh
  • 1,886
  • 4
  • 24
  • 37
2
votes
1 answer

Storing EJB 3 Session Bean references into Map

Currently I am using EJB3.0 session beans in my application. Normally i lookup the bean using jndi name and call the concerned method. But recently what I was suggested to store these references in a Map rather than looking up again and again. …
SacJn
  • 759
  • 1
  • 5
  • 14
2
votes
1 answer

Injecting stateful bean into stateless

I have read that @Stateful bean (SFSB) should be never injected into @Stateless bean (SLSB). But what is the correct way to achieve the following? @Stateless public class FirstEJB { @EJB private SecondEJB second; public void…
2
votes
1 answer

How to use JNDI to obtain a new Stateful Session Bean, in EJB3?

I'm trying to use JNDI to obtain a new Stateful Session Bean in a servlet (as a local variable). My doGet() method has the following: Bean bean = (Bean) new InitialContext().lookup("beanName"); I've tried including java:comp/env but all of my…
Eric Wilson
  • 51,818
  • 71
  • 192
  • 262
2
votes
1 answer

How to deal with discarded Stateful Session bean

Now and then, an operation in my stateful EJB (3.0) throws an SQLException (timeout expired). The method in which it happens: @PersistenceContext(unitName = "MYPU") EntityManager entityManager; List list; public List newSearch()…
Virginie
  • 809
  • 2
  • 11
  • 30
2
votes
1 answer

javax.ejb.NoSuchEJBException: Could not find stateful bean: 3j011-udy7sm-hkt798pd-1-hkt7bobh-9

Many times whenever I try to access some pages or click buttons "Could not find stateful bean: 3j011-udy7sm-hkt798pd-1-hkt7bobh-9"error hits on the screen for the JSF project.Do anybody know the cause for this errpr
shree18
  • 969
  • 1
  • 9
  • 15
2
votes
1 answer

Getting the same instance of an EJB in both Filter and ManagedBean

I'm trying to add a Filter to my Java EE application but I'm facing some problems. I want to use the filter for login purposes, so I need to let it "talk" with the UserManager bean that manages the login. Here's my structure : LoginFilter : the…
1
vote
2 answers

EJB Accessing Stateful Session Bean NameNotFoundException

I'm using a stateful session bean to create a shopping basket. I'm having trouble accessing my bean and am getting the following error ERROR BasketBean#ejb.remote.BasketBeanRemote -- service…
Chris
  • 2,705
  • 4
  • 31
  • 51
1
vote
3 answers

Stateful Session Bean - Stateloss Issue

I have a servlet code which invokes a stateful session bean code and increment an int value of it. But, when I am invoking the servlet and it's corresponding bean for the next time , the bean losses it's state and again starts from begining of…
alessandro
  • 1,567
  • 10
  • 30
  • 51
1
vote
1 answer

Issue with EJB - Stateful Session Bean and Servlet

I have a servlet code which calls a ejb stateful session bean code as follows, public class UsesBeansSF extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException,…
alessandro
  • 1,567
  • 10
  • 30
  • 51