A session bean encapsulates business logic that can be invoked programmatically by a client over local, remote, or web service client views. More specifically, a stateless session bean does not maintain a conversational state with the client, so it is mostly used as a service(e.g. rest api, persistence-retrieval) and does specific job without the need of keeping a state.
Questions tagged [stateless-session-bean]
188 questions
0
votes
1 answer
How to avoid concurrency in Stateless Session Bean?
I have a SLSB which increments a number in an entity. If two threads reach the SLSB at the same time, I'm getting the same number in both requests.
SLSB extract
@Stateless(mappedName = "ejb/CustomerManager")
public class CustomerManagerBean…

Emiliano
- 75
- 8
0
votes
1 answer
Can I reuse a session bean with another injected classes?
I have an application which consists of message driven bean and a couple of session beans. One of them has a DAO object, that is responsible for accessing database or FTP server.
I need to have two applications. The only difference between them is…

Dmitry D
- 760
- 12
- 24
0
votes
2 answers
Stateful session beans vs Stateless session beans, Instance variable dilemma
I have a stateless session bean, but I want to add a reference to another bean in order to do some process. So if I add reference to another bean it shows up at instance level variable like this,
@Stateless
public class AccountFacade extends…

TeaCupApp
- 11,316
- 18
- 70
- 150
0
votes
1 answer
Transactions not starting on JSF @ViewScoped @Stateless bean
I have a JSF 2 @ViewScoped based webapp, that I cannot get the transactions to go with correctly, or rather: they don't start at all.
I'm using Java EE 6's CDI and EJB3, too.
Here's the main bean:
import javax.faces.bean.ManagedBean;
import…

Kawu
- 13,647
- 34
- 123
- 195
0
votes
1 answer
synchronized block in ejb2 stateless session bean
So far i have heard that synchronized is not recommended for ejb session bean.
I have one problem that i resolved by using synchronized.
Code where i used synchronized.
if(strBatchID != null && strBatchNumber != null){
…

chetan
- 3,175
- 20
- 72
- 113
-1
votes
1 answer
Concurrent access Stateless Sessionbean from Singleton
If my understanding is correct, the container does not make concurrent calls to an SLSB. Calls are serialized or a new SLSB instance is created. My questions are:
Is it safe to access the SLSB from a singletion which has ConcurrencyManagement.BEAN,…

kai
- 6,702
- 22
- 38
-2
votes
1 answer
When does a stateless session beans gets a database connection?
I would like to understand about relationship between Stateless Sessionneans and DB Connections.
Can someone give me information to the following questions based on the Scenaraios below?
Thanks in advance.
When does a Stateless sessionbean gets a…

Mr. M
- 1
-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…

Muhammad Abdullah
- 69
- 2
- 9