Defining EJB 3.1 Views (Local, Remote, No-Interface)

This post will talk about possible ways of defining EJB views using annotations (I’ll just mention about using EJB Deployment Descriptor at the end.) I’ll focus on the most current EJB 3.1 views omitting legacy local, remote and home interfaces. Therefore, we can choose between: remote business interface view, local business interface view, no-interface view. I won’t discuss functional differences between those views but rather focus on possible ways of defining them....

March 20, 2013 · 5 min

Entities as Local Interface Parameters Can Harm You

Let’s start with a short quiz. TxMergeBean is a SLSB that uses CMT and EntityManager. Assume the following local and remote business interfaces: public interface TxMergeCommon { void methodA(); void methodB(MeineEntity entity); } @Local public interface TxMergeLocal {} @Remote public interface TxMergeRemote {} and the following SLSB: @Stateless public class TxMergeBean implements TxMergeRemote, TxMergeLocal { @PersistenceContext private EntityManager em; @EJB private TxMergeLocal self; @Resource private SessionContext sctx; public void methodA() { MeineEntity entity = new MeineEntity("methodA"); em....

March 14, 2013 · 4 min

Communication Between EJB Modules In The Same Application Server

This post describes some of the pitfalls when coping with intercommunication between different modules (EAR, WAR, EJB-JAR) deployed in the same Java EE 6 Application Server. The problem The problem is as follows: you have two modules (let’s take the EARs as an example) that are deployed in the same JVM / Application Server: App1.ear and App2.ear. App1.ear contains: service.jar; it’s an EJB-JAR with the business logic of the application, service-api....

November 17, 2012 · 7 min