Spring profiles management for application customization

Spring 3.1 GA was announced early this month. One feature we have been looking for some time is the new environment abstraction with bean definitions profile. While this abstraction allows to configure the profiles to use in many different locations, we found useful to be able to customize this even further to suit our needs. This blog post contains a simple implementation showcase, available on github. [...]

Remote partitioning with Spring Batch

In a previous article, we have discussed how staging the data to process with a sequence number could help us to build partitions that can be executed concurrently.  As explained in the documentation, the PartitionHandler is the component that knows about the mean to transport StepExecution requests to the actual worker(s). It basically sends one [...]

Staging and business chunking with Spring Batch

Spring Batch is a powerful batch framework in Java with obviously a close integration with the Spring framework. One core feature for us is the ability to stage the data to process for a particular batch instance. In this article, we will cover how data can be staged and the features that can be built on top of it. More specifically, we will cover how a partition can contain business chunks, i.e. a set of elements to process that are linked to another business concept. [...]

Configuring modular JPA applications with Spring

One of the top problem with JPA configuration is the inability to provide a true modular configuration of an application’s persistence unit. The persistence unit declares the entities that are to be included for a particular JPA-compliant implementation like Hibernate. The problem in practice is that it is forbidden to link entities if they are placed in two different persistence units so a single persistence unit, defined at the application level must be used. This single configuration file needs to declare the entities and/or the list of JAR files to be scanned in the application and it needs to be aware of all the modules that are used by the application (that is, it cannot update itself based on the available modules). This blog entry explains how this issue can be circumvented using Spring. A sample showcase project is also attached. [...]

Flexible JPA configuration with Spring

The Spring framework provides great configurable options and sensitive defaulting when it comes to initialize an EntityManager. The solution is not a silver bullet though but it is open enough to extend the mechanism through post processors.

Configuring the transaction type attribute namely is not as easy as it should be. Depending on whether you [...]