Home » Tag Archives: EJB

Tag Archives: EJB

Quick tip: Exception handling in Message Driven Beans

java-interview-questions-answers

Let’s do a quick review of exceptional handling with regards to Message Driven Beans. The entry point into a MDB is the overridden onMessage method. It does not provide any scope for throwing checked exceptions and as a result, you will need to propagate unchecked exceptions (subclass of java.lang.RuntimeException) from your code if you want to handle error scenarios. Types ...

Read More »

Timeout policies for EJBs : how do they help?

java-interview-questions-answers

EJB 3.1 introduced timeout related annotations as a part of its API. @AccessTimeout @StatefulTimeout Let’s quickly look at what they are and why are they important @AccessTimeout Specifies the time period after which a queued request (waiting for another thread to complete) times out. When your session bean instances are bombarded with concurrent requests, the EJB container ensures sanity by ...

Read More »

CDI & EJB: Sending asynchronous mail on transaction success

java-interview-questions-answers

Hello again! :) This time I’ve chosen a common task that most of the time, in my opinion, is done the wrong way: sending e-mails. Not that people can’t figure out how e-mail APIs work, such as JavaMail or Apache’s commons-email. What I usually see as a problem is that they underestimate the need to make the sending mail routine ...

Read More »

Where can I run EJBs ?

java-logo

EJBs are built for more than just a Java EE application server. They can also execute in a Java EE Web Profile container or plain Java SE environment (Java SE ! yeah – Easy Java Beans !). EJB Lite Required to support only a subset of the features which are provided by the full EJB specification – a lightweight version ...

Read More »

EJB 3.x : Lifecycle and Concurrency models (part 2)

java-interview-questions-answers

This is the second post of the two part series. The first part covered the life cycle and the concurrency behavior of Stateful and Stateless EJBs. I’ll cover Singleton EJBs in this post. The Singleton pattern is arguably the most used (some times misused!) pattern out there.         Java EE frees us from writing explicit code (like one on the above ...

Read More »

EJB 3.x : Lifecycle and Concurrency models (part 1)

java-interview-questions-answers

Java EE component life cycle and concurrency related details might not be new for seasoned professionals, but it is something which can take time to sink in for beginners.                 As far as EJBs are concerned, understanding their life cycle (and related concurrency scenarios) is extremely critical in order to ensure appropriate usage and solution ...

Read More »

Stateless EJBs: Pooling and Lifecycle

java-interview-questions-answers

A summarized view (notes) of the Stateless EJB pooling and life-cycle. Useful for newbies . . . . . EJB Pooling: Quick Overview EJB instances are stored in a location known as the EJB Pool – this is nothing but an in-memory cache. Stateless EJBs are generally instantiated on-demand i.e. as and when the client invokes a method on the ...

Read More »

EJB passivation and activation example

java-interview-questions-answers

In this tutorial we are going to see how activation and passivation works in a Stateful Java Enterprise Session Bean. 1. Introduction Stateful Session Beans usually hold information about a specific client, and holds that information throughout the whole session. It is a fact though, that client sessions tend to be active for a respectable amount of time, and of ...

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