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
is it okay to persist all entites with only one persist method that take an object as a parameter?
Can i do that:
> public void save(Object obj) {
> try {
> getHibernateSession().save(obj);
> } catch (Exception e) {
>
> e.printStackTrace();
> }
>
> }
pass any…

harold
- 1
- 1
0
votes
1 answer
@Stateless bean accessing data of @Singleton's bean in EJB3
I am new to EJB3.1 .Please bear with me if this is a trivial question. My requirement is to have a singleton class which will have certain data shared across
different beans. And to have different Threads accessing this singleton class's data . Let…
0
votes
1 answer
Servlet receives empty object from Remote EJB3 Session Bean
I'm sure this is a beginner error...
So I have a Java EE 6 application with entities, facades (implementing the persistence layer) and Stateless Session Beans (EJB3) with Remote interfaces (providing access to the entities via facades).
This is…

Hank
- 4,597
- 5
- 42
- 84
0
votes
1 answer
How to get a new Iterable for every call on Stateless EJB
I'm querying a DB in this EJB. Result is Iterable (I can't change that).
But since the EJB is @Stateless it will "reuse" the Iterable<>, and the query result just gets added to it. Instead of being a "new" one!
How could i avoid that ?
I don't know…

Wozilla
- 61
- 1
- 8
0
votes
0 answers
EJB3: Stateless beans: How to timeout all at once
Is it possible to timeout all stateless beans at once? IF possible, how?

lego.warrior
- 342
- 3
- 16
0
votes
1 answer
Most efficient way to provide EJB @Aynchronous methods for stateless logic
I need to create some EJBs to provide some @Aynchronous methods.
Some of the EJBs will have no state whatsoever.
Some might have CDI-injected (using @Inject) threadsafe instance variables that are @ApplicationScoped.
Is the following the most…

XDR
- 4,070
- 3
- 30
- 54
0
votes
1 answer
netbeans glassfish servlet error: NoClassDefFoundError
Is there some particular approach to ensure that an EJB module gets deployed to a web app correctly in Netbeans?
I'm coming at the EJB cookbook example, to invoke the Session Bean from the servlet. I cleared the glassfish output in Netbeans, did a…

Thufir
- 8,216
- 28
- 125
- 273
0
votes
1 answer
Bean Managed MDB and Database exceptions
I have a Bean managed MDB -InvoiceInquiryMessageBean with the following definition which calls a CMT - InvoiceManager which performs database operations.
The MDB is explicitly mentioned as Bean managed and the onMessage() has a transaction…

user3491141
- 53
- 8
0
votes
2 answers
Stateless session bean maintaining state
I deployed a web application on the localhost GlassFish server. This application takes order information from user and stores it in a List type variable in a Stateless Session Bean.The list object is created in the constructor.
I open the order…

Mangesh Kherdekar
- 313
- 3
- 15
0
votes
1 answer
WebSphere 5.1: Setting JDBC datasource connection as "unshareable"
L.S.
Our DB provider has suggested that we use "unshareable" connections when connecting to their DB. I have a reasonable understanding about the pros/cons of using "unshareable" connections, and our programming model will not cause any issues…
user265065
0
votes
1 answer
How I can use Java Reflection API within EJB 3 entity?
I do the following steps with eclipse 3.5 ,JBoss 4.2 ,EJB3 but I face class not found exception
1.compiling this code to foo.jar file
package mypackage.foo;
import myejbpackage.ejb.fooInterface;
class foo implements fooInterface{
@override
void…

mebada
- 2,252
- 4
- 27
- 35
0
votes
1 answer
EJB Bean is associated with a different unfinished transaction
Please look at this snippet:
@Stateless
public class A {
@EJB
B b; // B is stateful EJB
b.init(); // initialize Sets and List that are used in doSthInB(C c)
public void doSthInA(){
for(C c){
b.doSthInB(c); //…

Marcin Sanecki
- 1,324
- 3
- 19
- 35
0
votes
0 answers
Why is an injected value sometimes null inside my custom ConstraintValidator?
i created a custom ConstraintValidator Annotation which called APIAuth,
and i tried to fetch the remote user IP Address Using @Context HttpServletRequest , but the problem is when calling the APIAuth inside my Stateless , the APIAuth custom…

Jason4Ever
- 1,439
- 4
- 23
- 43
0
votes
1 answer
Session Facade and Data Transfer Object
Multiple fine-grained invocations of Entity Beans add the overhead of network calls, even multiple transaction. In other words, the risk is to have a solution that has a high network overhead, high coupling, poor re-usability and maintainability. We…

Kahn
- 755
- 3
- 11
- 28
0
votes
1 answer
EJB threadsafe Singleton bean VS EJB threadsafe Stateless bean
This question is to compare EJB Singleton bean and Stateless bean in the case both them are Threadsafe (No state holding OR Readonly State). I thought they can be used for the same purpose ( in case they are threadsafe). If I understand wrong, can…

LHA
- 9,398
- 8
- 46
- 85