stateful-session-bean

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 transaction and CDI @ViewScoped bean which is used on the...

Stateful session beans unexpected behaviour when packaged in a war and packaged in an ear->jar

I am new to ejbs. I wrote a stateful session bean scoped @SessionScoped. Then I injected the ejb into my servlet. @Local @SessionScoped @Statueful public class CartServiceImpl implements CartService { private int i = 0; public int getI() { return i++; } } In my servlet @Inject private CartService...

LazyInitializationException with CDI Managed Bean and Stateful Session Bean

I have a CDI Managed Bean (a bean annotated with @Named that is used on JSF) that has a Stateful Session Bean injected. This session bean is like a service, it has the entity manager (annotated with @PersistenceContext(type= PersistenceContextType.EXTENDED)) and expose come methods to manipulate...

Java EE 6: How to call Stateful Session Bean from Stateless Session Bean?

I have a Stateful Session Bean (SFSB) which acts as authentication module. In the SFSB I store the current user that is logged in. Moreover I have some facades (which are Stateless Session Beans (SLSB)) that handles the JPA/SQL stuff for my entities. In order to check the access permissions of the...

When to use Stateful session bean over Stateless session bean?

A stateful session bean is defined as follows: Stateful Session Beans The state of an object consists of the values of its instance variables. In a stateful session bean, the instance variables represent the state of a unique client-bean session. Because the client interacts (“talks”) with its bean,...

access existing instance stateful inside stateless, java ee 6

Is it possible to access a stateful session bean inside a stateless bean? My problem is that I have a session bean called User and I want to access user info inside a stateless bean... I am trying like this: Ejb Side: @Stateless public class OfferManagerBean implements OfferManagerLocal,...