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
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
0
votes
0 answers

Is it true that the session bean in Java EE can create a Shopping Cart like session in ASP

When I make a commercial website in ASP, I use the session to keep the items in shopping cart even the customer close the website (when they come back, all items still in their cart). I am reading about Java EE, especially about stateless and…
0
votes
1 answer

EJB 3.1 Stateful Bean behaves like a Singleton Bean

I'm trying to program an EJB 3.1 using Stateful Session bean. I should have understood quite well what an EJB is and the difference between stateful, stateless and singleton. But my stateful bean has a strange behaviour. It behaves as a…
Alessio Fiore
  • 467
  • 1
  • 7
  • 18
0
votes
1 answer

Differences between Stateful session bean and POJO linked in a SessionScoped ManagedBean

I'm quite new to Java EE and I was asking myself the following question: What are the differences between holding a link to a Stateful session bean and holding a link to a POJO in a SessionScoped Managed bean? Since the ManagedBean is sessionscoped…
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
0
votes
1 answer

Java EE 6 - Pessimistic Locking - ViewScoped bean + Stateful bean with UserTransaction, PreDestroy and other problems

In application I'm working on we need to start transaction before user enters 'edit page' (to lock DB records currently edited) and end it when he clicks the button or left the page. For this purpose I use @Stateful EJB bean which manages the…
0
votes
1 answer

Serializability of injected CDI bean into stateful EJB

I've got stateful EJB and injected to it application scope CDI bean. Findbugs gave a warning, because my CDI bean was not serializable. Should the CDI bean be serializable in this case? In my opinion it shouldn't, in order to avoid passivation. Is…
mmatloka
  • 1,986
  • 1
  • 20
  • 46
0
votes
1 answer

Why when I convert managed bean to SFSB do I get TwoPhaseCoordinator.afterCompletion - returned failure for SynchronizationImple

My @SessionScoped WorkflowManager managed bean was able to reset state when session timed out, causing Welcome splash screen to be displayed. After adding @Stateful to the WorkflowManager the Welcome screen is not consistently shown and it seems…
Patrick Garner
  • 3,201
  • 6
  • 39
  • 58
0
votes
1 answer

Passing parameters between Request Scoped Managed Beans in JSF + EJB 3.1

Our problem is a very basic, simple implementation of editing the database using JSF + EJB. Keeping things short: two separate XHTML views, use two separate Managed Beans @RequestScope. WebuserListBean and EditWebuserBean, and with @ManagedProperty…
Atais
  • 10,857
  • 6
  • 71
  • 111
0
votes
2 answers

Stateful Bean : serlvet takes wrong value while managedBean not

I've got a Stateful Session Bean which holds my login session, a JSF Session Bean and a Servlet Filter. What I ned to do is to stop non logged users from accessing my pages, so I did a filter. The doFilter() its like this : public void…
StepTNT
  • 3,867
  • 7
  • 41
  • 82
-1
votes
1 answer

Common resource (almost stateful) object (bean) (no HTTP session related) in Play Framework?

I have external library that requires very long initialization time (approx. 2 minutes) and I need to call it in almost every HTTP request that is handled by Play Framework Controller-Action. Is there mechanism to instantiate such Scala object (e.g.…
TomR
  • 2,696
  • 6
  • 34
  • 87
-1
votes
1 answer

How to make data persistent across pages using a Stateful Session Bean?

I'm working on a shopping cart with JEE. My web application is made of one stateful session bean and two servlets with corresponding JSP pages. One servlet allows to add new items to the cart, the other allows to list the content of the cart. The…
user1636522
-1
votes
1 answer

Session tracking in HttpSession or in Stateful Session Bean?

I want to develop a jsf web application like shopping cart and must have to login before shopping. How can i tracking each user session. What will be the best way in this situation. Track session in presentation layer (HttpSession) or Stateful…
user3302257
  • 69
  • 3
  • 11
-2
votes
1 answer

What is the default type of a Session Bean?

I was reading best practices related to JavaEE APIs and came across a suggestion to use @Stateless and @Path together to make thread safe. That prompted me to inquire that when we do not mention anything, what is the type of session bean? Is it by…
1 2 3 4 5 6 7
8