Questions tagged [session-bean]

A session bean encapsulates business logic that can be invoked programmatically by a client over local, remote, or web service client views.

To access an application that is deployed on the server, the client invokes the session bean’s methods. The session bean performs work for its client, shielding it from complexity by executing business tasks inside the server.

96 questions
0
votes
0 answers

Why Stateful bean is showing the opposite behavior

I am getting different instances (on clicking Test then going back and repeating) of the Demo. I was expecting the same instance. Can someone explain what I am missing here? Bean @Stateful @LocalBean public class Demo { public Demo() { …
0
votes
2 answers

Calling a method on Session Bean from POJO?

Given only the fully qualified class name/interface name of the Session Bean, is it possible to instantiate call a method on it from a POJO? If yes, how? Thanks, TheLameProgrammer
TheLameProgrammer
  • 4,037
  • 5
  • 19
  • 16
0
votes
1 answer

How can I reach JSF @Singleton Bean from inside @SessionScoped Bean and vice versa?

My purpose is to have a @Singleton class which runs automated scheduled methods throughout the application on a cloud server. But I also have @SessionScoped beans which I would like to communicate with. Is it possible to reach a @SessionScoped bean…
v-peter
  • 1
  • 2
0
votes
1 answer

Java EE Entity session bean best practices and where to find them - Where does a retrieveAfromB method go to?

This may not entirely be an appropriate question to ask, but why not I'm curious and I do not know the right places to look for these answers (If y'all have links to said places please do drop them down!). So say we have Entity A and B, of which A…
Ziyue
  • 1
  • 1
0
votes
1 answer

How to implement polling in Spring together with Observer pattern

I'm trying to implement a service that asynchronously performs polling via a thread and then notifies a list of observers. The architecture is as follows: multiple concurrent jsf session beans can register to the singleton service and be notified by…
0
votes
0 answers

Cannot resolve reference Local ejb-ref. Communication between 2 EJB modules

I have 2 EJB modules and I want to make communication between them. EJB module has EB (Entity Bean) and SB (Stateless Sesssion Bean) (With Local Facades) EJB module has a simple public class Test which uses local facade (MyairportsFacadeLocal) from…
Domagoj Hamzic
  • 300
  • 3
  • 17
0
votes
1 answer

How to keep a bean alive for the through session accessible from filter and EJB

I am trying to set a property to a bean ModelBean in a Filter and access this property in a JSF controller IndexController. The ModelBean is annotated @SessionScoped and it is used in the filter and controller with @Inject. The problem is that two…
BanzaiTokyo
  • 1,376
  • 4
  • 17
  • 33
0
votes
1 answer

which way is best and worst to find and display customer lived in newyork? stateful or stateless or singleton?

I am trying to get the number of customer who lived in newyork and display on my page. But some doubt in my mind, which way is best to worst, Like stateless, stateful and singleton ejb? Any idea, which way i have to implement my application.
0
votes
1 answer

Java EE Transactional Type across various types of Beans

Consider the following scenario : Stateless Annotated Class ClassOne @Stateless public class ClassOne { // some injected fields // .... @Inject private ClassTwo classTwo; // .... public void methodInClassOne() { try…
0
votes
0 answers

How do replicate a "Session Bean" in a Java SE context?

I'm developing a java SE application containing a single main class inside a Maven module. The main class invokes classes contained in another Maven modules. I would like to have an instance of java bean that is common to any application. This Bean…
user3347007
  • 77
  • 1
  • 2
  • 9
0
votes
3 answers

Why need a session bean?

I can use jsp to write a web application, I can use jsp to execute a SQL statement to maintain database, why I need a session bean? What make the session bean so special? thank you.
Tattat
  • 15,548
  • 33
  • 87
  • 138
0
votes
1 answer

Netbeans - storing username in the session bean?

I am currently trying to pass the username to a servlet in netbeans. The username is input in the login, such that I then access this username in servletA by String username =…
Maja
  • 59
  • 1
  • 11
0
votes
0 answers

Entity class not found error

Im new to java EJB ,Im getting this erro. i think its regarding entity class. can some one help me to fix this issue, thanks a lot. Warning: StandardWrapperValve[registrationsServlet]: Servlet.service() for servlet registrationsServlet threw…
0
votes
0 answers

Use session bean to hold datasource connection

I have made a database wrapper in java to connect to a datasource. The way I connect to the datasource is with the following line: DB db = new DB(); Then I can just start doing queries like db.setQuery("select *…
gab06
  • 578
  • 6
  • 23
0
votes
1 answer

Using @Lock annotation instead of the synchronized keyword

Application Setup (simplified) I feel like I am pretty familiar with concurrency in Java, but I am relatively new to Java EE and its annotations. I have a class called DataHandler annotated with @Singleton that performs some business logic for my…
Evan LaHurd
  • 977
  • 2
  • 14
  • 27