Tag Archives: JPA

Database Encryption Using JPA Listeners

via Invariant Properties » Database Encryption Using JPA Listeners.

I recently learned how to handle spring injection into JPA listeners. Details at http://invariantproperties.com/2013/09/29/spring-injected-beans-in-jpa-entitylisteners/. This small project includes a variant of the classes discussed below.

Version-Based Optimistic Concurrency Control in JPA/Hibernate

via Version-Based Optimistic Concurrency Control in JPA/Hibernate | Konrad Garus.

This article is an introduction to version-based optimistic concurrency control in Hibernate and JPA. The concept is fairly old and much has been written on it, but anyway I have seen it reinvented, misunderstood and misused. I’m writing it just to spread knowledge and hopefully spark interest in the subject of concurrency control and locking.

Monitoring the JBoss EAP / Wildfly Application Server with the Command Line Interface (CLI)

The JBoss EAP / Wildfly provides a powerful concept for management, configuration and monitoring of the JBoss Application Server itself and its Java EE Applications. The concept is based on the detyped management API. All management clients of the application server use this detyped management API to interact with the server. In this post we […]


Paradigm Mismatch and Entity Relationship Representation.

This blog throws some light into possibilities of representation of relationships between entities in the world of JPA in EJB3, particularly Inheritance, Composition, Association. This example is mainly to demonstrate the Real world relationships that could be contained in the ORM universe dispite the “Impedance or Paradigm Mismatch” that exists between the RDBMS and the […]


EJB: Container Managed Transactions.

Transactions are very important particularly in a multi threaded environment. We already know of the famous ATM (Simplified) example where a withdrawal happens in two simple steps. First is is where the server updates the new balanace into the database and second where the money is provided to the requestor. Now with the existence of […]


Transaction handling in EJBs and JavaEE7 @Transactional

Handling transactions in EJBs is easy, right? Well, in theory it should be. But how does the theory translate into reality once you leave the ivory tower? I’ll show you a small example. Let’s assume we have 2 infrastructure service EJBs: @Stateless public class StorageServiceImpl implements StorageService { private @EJB CustomerService customerService; private @PersistenceContext EntityManager […]


Customizing Spring Data JPA Repository

via Programming Peacefully: Customizing Spring Data JPA Repository.

Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide implementation of the DAO based on SimpleJpaRepository. In recent project, I have developed a customize repository base class so that I could add more features on it. You could add vendor specific features to this repository base class as you like.