Questions tagged [stateless-session-bean]

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.

188 questions
4
votes
2 answers

What does a stateless session bean provide over just a normal class?

What would a stateless session bean provide over just a regular class that has the same methods? It seems that a stateful session bean can be distributed out of the box and the container will make sure that the state looks the same to clients…
benstpierre
  • 32,833
  • 51
  • 177
  • 288
4
votes
2 answers

jndi binding for local and remote stateless bean

I'm trying to implements an EJB3 stateless with a remote and local interfaces the problem is the local one is called in an other remote EJB with the annotation @EJB but it returns null or ClassCastException (java.lang.ClassCastException:…
R Vive L OL
  • 177
  • 3
  • 3
  • 10
4
votes
1 answer

EJB-@Singleton to manage query results

Should I use EJB-@Singleton (javax.ejb.Singleton) for statistics or monitoring or would it be better to cache the statistics in common @SessionScoped-Bean? To clear my question, here are two scenarios: Scenario I: A User begins a Websession and…
3
votes
1 answer

Stateless EJB with more injected EJBs instances

I know Stateless EJBs are stored in a pool and instantiated as needed, my question is, what happens when there are more EJB dependencies, for example with something like this: @Remote @Stateless public class Master_EJB{ @EJB private EJB_A…
jasalguero
  • 4,142
  • 2
  • 31
  • 52
3
votes
2 answers

Transaction TimeOut EJB impact on the thread

A question on EJB: Let's say I have a session bean which has an infinite loop. It is running under a EJB transaction. Now when the transaction of the EJB times out, will that cause the infinite loop thread to break or container will stop the thread…
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
3
votes
0 answers

Startup ejb depending on another startup ejb in another module

I have a singleton startup ejb A which depends on another singleton startup ejb B which is in another module. I added depends on annotation but the deployment failed with no ejb found exception. Then I moved the startup ejb to the module where the…
Krishna Chaitanya
  • 2,533
  • 4
  • 40
  • 74
3
votes
3 answers

Stateless Session Bean

Do I package a stateless session bean in a war file or a ear file for deployment?
user422930
  • 259
  • 1
  • 5
  • 15
3
votes
1 answer

Lookup EJB with local interface on WildFly

I've got an ear with the following structure: app-ear app-api app-ejb app-web The app-web and app-ejb depends on the app-api module, but they are not depending on each other. The interfaces (app-api) and the bean…
3
votes
1 answer

How to inject a Stateless Session Bean into a Message Driven Bean?

I'm trying to inject a remote stateless session bean in a message driven bean. I've been looking this post: How to inject a Session Bean into a Message Driven Bean? The Session Bean and the Message Driven Bean are in two diff. Here an exemple of…
3
votes
2 answers

why pool stateless bean?

Normally we use singleton instance for business / dao layer. What is the reason behind pooling stateless session beans in case of EJBs?
3
votes
1 answer

Proper use of instance variables in a stateless EJB timer

I know that the use of instance variables within stateless session beans is a popular discussion topic and have already read some of them, but what i am specifically need from this topic, is the actual proper design of my application. My enterprise…
3
votes
2 answers

Singleton vs Stateless beans in the architecture of a Java EE application

A part of business logic at the core of my project has to perform a search on linked-data. Currently, I have implemented this part using a singleton session bean like this (SPARQL is a query language on RDF models which are constructed using linked…
3
votes
1 answer

Any thread safety benefits of exposing a web service as a stateless session bean?

Are there are any thread safety related benefits of exposing a web service as a stateless session bean? (Correct me if i am wrong) but I think web services are not thread safe and like Servlets only one instance of a web service class is created by…
2
votes
1 answer

Can I be sure that a SLSB which created a Timer will be handling its timeout (Java EE 5)?

In Java EE 5, when using timers and the timer service, who handles the timeout invocation? Can I be sure that the stateless session bean which created the timer wil be the one to handle its timeout (with a @Timeout annoateted method)? or there's no…
wafwaf
  • 651
  • 12
  • 24
2
votes
1 answer

EJB3 DAO stateless session bean design (use JDBC connection)

I'm designing a DAO layer for a EJB3 project, they are stateless session bean. For some reason, part of DAOs won't use JPA, they access database directly with JDBC. So instead of injecting EntityManager, I inject a Datasource and from it I can get…
cn1h
  • 1,188
  • 4
  • 16
  • 24
1
2
3
12 13