Questions tagged [ejb]

Enterprise JavaBeans (EJB) is a managed, server-side component architecture for modular construction of enterprise applications. The EJB specification is one of several [Java] APIs in the [Java EE] specification.

Enterprise JavaBeans (EJB) is a managed, component architecture for modular construction of enterprise applications which runs on an . The EJB specification is one of several APIs in the specification.

See also and

Tutorials

JBoss 4 EJB 3 Tutorial

JBoss 5 EJB 3 Tutorial

Video Tutorials

EJB Video Training

Reference :

Wikipedia

Oracle

6693 questions
36
votes
2 answers

@Inject, @EJB, @Local, @Remote, @LocalBean, etc... : confused?

I have the following configuration: 1 EAR on one GF containing 2 EJB-JARs with EJB components. 1 WAR on another Glassfish server (=> other JVM) containing web components accessing the EJB components. I have 2 EJB business services in each EJB-JAR…
Blaise Gosselin
  • 506
  • 1
  • 5
  • 7
36
votes
2 answers

Default EJB transaction mode for asynchronous methods?

When I have an @Asynchronous method in an EJB, and I don't specify the @TransactionAttribute, then how exactly does the container handle the transaction boundaries? Obviously, it can't use the calling thread's transaction, so what does it do? Same…
Mike Baranczak
  • 8,291
  • 8
  • 47
  • 71
36
votes
3 answers

Difference between javax.inject.Singleton and javax.ejb.Singleton

im little confused. What is the exact difference between javax.inject.Singleton and javax.ejb.Singleton?
Hakan Kiyar
  • 1,199
  • 6
  • 16
  • 26
35
votes
3 answers

Detached Entity and Managed Entity

What a "detached entity" means? How is it possible to convert a managed entity to a detached entity during a transaction?
Shemil
  • 387
  • 1
  • 7
  • 12
34
votes
2 answers

@Schedule annotation run every few minutes (or seconds)

I would like to try to use the @Schedule annotation in the following way: public class MyTestServlet extends HttpServlet { private static JcanLogger LOG = JcanLoggerFactory.getLogger(ServiceTestServlet.class); @EJB CronService…
cscsaba
  • 1,279
  • 3
  • 20
  • 31
33
votes
2 answers

Gradle: Could not find method providedCompile()

How are this and this build file able to use providedCompile? thufir@doge:~/NetBeansProjects/gradleEAR$ thufir@doge:~/NetBeansProjects/gradleEAR$ gradle clean FAILURE: Build failed with an exception. * Where: Build file…
Thufir
  • 8,216
  • 28
  • 125
  • 273
32
votes
3 answers

Wildfly and auto reconnect to the database

I've got a client, a server and a database. The client communicates with the server via a EJB remote interfaces. As the server - I use a Wildfly 8.2.0. As the database - I use a MySQL. The server communicates with the MySQL via a JPA/Hibernate. When…
Robert
  • 762
  • 2
  • 10
  • 23
31
votes
3 answers

Multiple writable mappings exception in EclipseLink

I have these tables: Which my intention is : A user can be a company or a person but each one of them have something in common, as username which is the email and password, so I used the JPA Tools to generate the entities from the table which…
Valter Silva
  • 16,446
  • 52
  • 137
  • 218
31
votes
8 answers

Stateless Session Beans vs. Singleton Session Beans

The Java EE 6 Tutorial says: To improve performance, you might choose a stateless session bean if it has any of these traits: The bean’s state has no data for a specific client. In a single method invocation, the bean performs a generic task for…
deamon
  • 89,107
  • 111
  • 320
  • 448
30
votes
4 answers

When to use Spring @Transactional (propagation = Propagation.SUPPORTS)?

According to the Spring javadoc @Transactional(propagation = Propagation.SUPPORTS) Support a current transaction, execute non-transactionally if none exists. Analogous to EJB transaction attribute of the same name. It seems that I can just…
ams
  • 60,316
  • 68
  • 200
  • 288
29
votes
7 answers

What use are EJBs

I'm currently learning Jave-EE, having plenty of C++ experience and having learned Java SE. I don't understand the purpose of Enterprise Java Beans; can someone clarify this for me. I'm not interested in legacy uses: this is in the context of…
Raedwald
  • 46,613
  • 43
  • 151
  • 237
29
votes
5 answers

Jboss Java EE container and an ExecutorService

I have a standalone java app which used the ExecutorService to process a number of jobs in parallel ExecutorService es = Executors.newFixedThreadPool(10); I now want to re-use the same solution within an EJB bean but am unsure how to correctly…
emeraldjava
  • 10,894
  • 26
  • 97
  • 170
28
votes
5 answers

How to inject @EJB, @PersistenceContext, @Inject, @Autowired, etc in @FacesConverter?

How can I inject a dependency like @EJB, @PersistenceContext, @Inject, @AutoWired, etc in a @FacesConverter? In my specific case I need to inject an EJB via @EJB: @FacesConverter public class MyConverter implements Converter { @EJB protected…
user550738
28
votes
5 answers

Why pool Stateless session beans?

Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local…
27
votes
4 answers

what is a abstract method on a interface in java

Possible Duplicate: Why would one declare a Java interface method as abstract? I found the following code in one of our ejb interfaces. Does anyone know what the abstract does in the interface? If you do please also explain why it might be needed…
Marthin
  • 6,413
  • 15
  • 58
  • 95