Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

h2: Overview

The UnitOfWorkProtocol aspect makes the Unit Of Work management transparent in the user code.

It will allow you to write your code like this:

Instead of like this:

and still all the transaction and persistence management will take place.

h2: Definition

The UnitOfWorkProtocol aspect has four pointcuts that you have to define in your XML definition file (a "transactional object" is an object that is set to participate in the Unit Of Work transaction, meaning that the Unit Of Work will keep track of its state):

  • transactionalObjects - picks out all transactional object, this pointcut is used by the Transactional Mixin
  • transactionalMethods - picks out all points in the code where you want a transaction to begin, commit and rollback
  • transactionalObjectCreationPoints - picks out all points in the code where a transactional object is created
  • transactionalObjectModificationPoints - picks out all points in the code where a transactional object is being modified (best done with a set(...) pointcut)

Here is an example on how to define this in XML:

  • No labels