Questions tagged [ejb-3.0]

This tag is used for question related to the session bean and message-driven bean component types of the EJB 3.0 programming model. For questions about the persistent entities defined in the document "Java Persistence API" of the EJB 3.0 specification, use the [JPA] tag.

JSR 220: Enterprise JavaBeans 3.0

The Enterprise JavaBeans architecture is a component architecture for the development and deployment of component-based business applications.

The purpose of Enterprise JavaBeans (EJB) 3.0 is to improve the EJB architecture by reducing its complexity from the developer's point of view.

The goal of EJB 3.0 is to target ease of development, the main theme of the Java EE 5 platform release. EJB 3.0 is a major simplification over the APIs defined by the EJB 2.1 and earlier specifications. The simplified EJB 3.0 API allows developers to program EJB components as ordinary Java objects with ordinary Java business interfaces rather than as heavy weight components. Both component and client code are simplified, and the same tasks can be accomplished in a simpler way, with fewer lines of code. Because it is much simpler, EJB 3.0 is also much faster to learn to use than EJB 2.1.

2345 questions
21
votes
6 answers

Named Query Or Native Query or Query Which one is better in performance point of view?

Which one is better among following(EJB 3 JPA) //Query a). getEntityManager().createQuery("select o from User o"); //Named Query where findAllUser is defined at Entity level b). getEntityManager().createNamedQuery("User.findAllUser");** //Native…
Jekin Kalariya
  • 3,475
  • 2
  • 20
  • 32
21
votes
5 answers

Best current framework for unit testing EJB3 / JPA

Starting a new project using EJB 3 / JPA, mainly stateless session beans and batch jobs. I've used JUnit in the past on standard Java webapps and it seemed to work pretty well. In EJB2 unit testing was a pain and required a running container such…
Dark Castle
  • 1,289
  • 2
  • 9
  • 20
21
votes
6 answers

Best features of EJB 3

The scenario You have developed a webapp using EJBs version 3. The system is deployed, delivered and is used by the customer. If you would have to rewrite the system from scratch, would you use EJBs again? No: Don't answer this question, answer…
Arne Evertsson
  • 19,693
  • 20
  • 69
  • 84
20
votes
4 answers

EJB3 Local and Remote interfaces

I understood that Local interface is designed for clients in the same container's JVM instance and remote interface is designed for clients residing outside the EJB container's JVM. How about the web application client which is not reside (or…
Thurein
  • 6,645
  • 5
  • 22
  • 23
20
votes
4 answers

Relationship between EJB 3.0 and JPA?

That may seem obvious but I've seen contradictory statements: Is JPA part of EJB 3.0? I'm no specialist and it's quite confusing for me. If so, JPA manipulates Entity Beans? These entity beans being the interface between the persistence layer and…
LB40
  • 12,041
  • 17
  • 72
  • 107
20
votes
6 answers

JBoss: What does the warning EJBTHREE-1246 from the InterceptorRegistry mean?

I am currently developing an EJB 3.0 based application on the JBoss AS 5.0.0.GA and just recently the following warning showed up in the server log: 09:50:19,735 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a…
Simon Lehmann
  • 10,737
  • 4
  • 41
  • 53
20
votes
6 answers

JPA entity has no primary key?

I have an Entity class: @Entity @Table(name="CMC_MAP_SERVER_INFO") @NamedQuery(name="CmcMapServerInfo.getMapServer", query="SELECT c FROM CmcMapServerInfo c") public class CmcMapServerInfo implements Serializable { private static final long…
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
19
votes
5 answers

Inheriting class annotations

Is there a way to make classes inherit annotations from a superclass ? e.g. @ApplicationException(rollback=true) public abstract class AbstractBeanActionException extends Exception { /* method body is simply calls to super() */ } public class…
Luke
  • 3,481
  • 6
  • 39
  • 63
19
votes
5 answers

Unsatisfied dependencies for type [...] with qualifiers [@Default] at injection point (using @Stateful EJB with CDI)

I have the following code to manage two kinds of repositories. Both repository classes inherit an interface to allow reinitialization of their resources. public interface CachingRepository { public void invalidateCache(); } Global,…
Kawu
  • 13,647
  • 34
  • 123
  • 195
18
votes
3 answers

How does EJB and JPA relate?

I am reading the EJB 3 in Action book and I have the following question : Is the POJO's you write and annotate with @Entity and so on also a EJB entity type? I don't understand what JPA has to do with EJB. Isn't JPA a own specification now? The…
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
18
votes
3 answers

Better Exception Handling in JPA

I used EJB3/JPA when persisting my entities and I am happy on how it is able to manage my DB related task. My only concern is on the exception handling. My sample code when saving entity always comes in this flavor. Most of the tutorials that I…
Mark Estrada
  • 9,013
  • 37
  • 119
  • 186
18
votes
6 answers

How to stop endless EJB 3 timer?

I am new to EJB 3 . I use the following code to start endless EJB 3 timer then deploying it on JBOSS 4.2.3 @Stateless public class SimpleBean implements SimpleBeanRemote,TimerService { @Resource TimerService timerService; private Timer timer…
mebada
  • 2,252
  • 4
  • 27
  • 35
17
votes
6 answers

In @Table(name = "tableName") - make "tableName" a variable in JPA

I am using JPA and I need to make the "tableName" a variable. In a database, I have many tables, and my code needs to access the table where I specify it to read. @Entity @Table(name = "tableName") public class Database implements Serializable…
zengr
  • 38,346
  • 37
  • 130
  • 192
16
votes
9 answers

What's the best way to share business object instances between Java web apps using JBoss and Spring?

We currently have a web application loading a Spring application context which instantiates a stack of business objects, DAO objects and Hibernate. We would like to share this stack with another web application, to avoid having multiple instances of…
16
votes
1 answer

JPA composite primary key with null value

I have a table containing customer data in an oracle database. Here is a simplified definition: CUSTOMER (CUSTOMER_ID NUMBER NOT NULL, SOURCE_SYSTEM VARCHAR2(30), FULL_NAME VARCHAR2(360), PHONE_NUMBER VARCHAR2(240) …
Matsu Q.
  • 468
  • 1
  • 9
  • 17