Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



Build status

A VRaptor JPA plugin to use with VRaptor 4 with environment support.


Copy the jar file to your app or use:

	<version>4.0.2</version> <!-- or the latest version -->

This plugin doesn't include any JPA Provider. You need to add your prefered provider.

Transactional Control

The default behavior is that each request will have a transaction available.

If you want, you can enable a decorator to change this behavior.

When enabled, it will open transactions only for methods with @Transactional annotation.

To do that you just need to add the follow content into your project's beans.xml:


CDI Events

While the JPATransactionInterceptor worries about handling the transaction, you can observe CDI events to include some logic of yours.

Please, note that if you specializes or override the JPATransactionInterceptor, those events won't be fired.

Remember that CDI Events doesn't have an order when executing observers, so, when observing the same event in more than one method, they should be independents.

The events are:

  • Before trying to commit the transaction: BeforeCommit;
  • After successfully committing the transaction: AfterCommit;
  • After successfully rolling back (rollback) the transaction: AfterRollback;
import javax.enterprise.event.Observes;


public class JPATransactionEventsObserver {
	/* You can @Inject any dependencies here. */

	public void beforeCommit(@Observes BeforeCommit before) {/* ... */}

	public void afterCommit(@Observes AfterCommit after) {/* ... */}

	public void afterRollback(@Observes AfterRollback after) {/* ... */}


Get help from vraptor developers and the community at VRaptor's mailing list.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.