Building a project with a persistence layer and transaction support for deployment in Karaf

Transaction support for your JPA-persisted data can be simply added by introducing Apache Aries JTA modules to your project. The JTA components provide a transaction manager that coordinates data storage and retrieval.

In the Building a project with a persistence layer for deployment in Karaf recipe, we learned how to use JPA and OpenJPA to build a simple application that persists recipes to a database using a RecipeBookService class. In this recipe, we'll add container-based transaction management via JTA.

Getting ready

The ingredients of this recipe include the Apache Karaf distribution kit, access to JDK, and Internet connectivity. Sample code for this ...

Get Apache Karaf Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.