Home » Tag Archives: EJB (page 2)

Tag Archives: EJB

Java EE EJB Interceptors tutorial and example

java-interview-questions-answers

In this example we are going to see how to use Interceptors in an EJB and test it using a simple Web Application. 1. Introduction Interceptors are used, as the name suggests, when you want to intercept calls to EJB methods. If you declare an Interceptor for a Bean, every time a method of that Bean is invoked, it will ...

Read More »

JBoss AS7 JNDI & EJB 3.1 Naming changes

jboss-logo

As a result of the “feature train” continuing to march on and us not keeping our software stack up-to-date, our team finds ourselves in the un-enviable position of having to migrate: JBoss 4.2.3 to AS 7.1.x (currently looking at 7.1.1) EJB 2.1 to EJB 3.1 Hibernate 2 to Hibernate 3 or 4 in quick fashion.  I mean, who wants to ...

Read More »

EJB Inheritance is Different From Java Inheritance

java-interview-questions-answers

Despite the fact that EJB inheritance sometimes uses Java inheritance — they’re not always the same. Just as you could read in my previous post, EJB doesn’t have to implement any interface to expose a business interface. The other way around is also true — just because EJB is implementing some interface or extending other EJB doesn’t mean it exposes ...

Read More »

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

java-interview-questions-answers

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 ...

Read More »

Four solutions to the LazyInitializationException – Part 2

jsf-logo

This article continues from part 1 of the tutorial. Load collection by Stateful EJB with PersistenceContextType.EXTENDED This approach can be applied only to applications that works with Full JEE environments: to use a EJB with PersistenceContextType.EXTENDED. Check the code below how the DAO would look like: package com.ejb; import javax.ejb.Stateful; import javax.persistence.*; import com.model.Person; @Stateful public class SystemDAOStateful { @PersistenceContext(unitName ...

Read More »

Four solutions to the LazyInitializationException – Part 1

jsf-logo

In the post today we will talk about the common LazyInitializationException error. We will see four ways to avoid this error, the advantage and disadvantage of each approach and in the end of this post, we will talk about how the EclipseLink handles this exception. To see the LazyInitializationException error and to handle it, we will use an application JSF ...

Read More »

Full WebApplication JSF EJB JPA JAAS – Part 1

jsf-logo

This post will be the biggest so far in my blog! We will see a full web application. It will be done will the newest technologies (until today), but I will give some hints to show how to adapt this post to older technologies. In the end of this post you will find the source code to download. You can ...

Read More »

Full WebApplication JSF EJB JPA JAAS – Part 2

jsf-logo

View – Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay attention: in some moment the Eclipse will ask you if you want to add the JSF Capabilities (auto complete), enable it. Like the screens bellow: After the project creation, let us edit ...

Read More »

Java EE 6 Testing Part I – EJB 3.1 Embeddable API

java-logo

One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit/integration testing support. EJB 3.1 Specification introduced the EJB 3.1 Embeddable API for executing EJB components within a Java SE environment. Unlike traditional Java EE server-based execution, embeddable usage allows client code and its corresponding enterprise beans to run within the same JVM and class ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close