Implementing your transactions

Every Transaction represents one or more changes to the system, and you can think of everything that goes inside the executeOn() method as pertaining to a BEGIN ... COMMIT block in your database.

In the case of our AddTask transaction, it's helpful to return the Task we just created to the users, so they can manipulate it further. We implement TransactionWithQuery:

An error occurred: cvs.prevayler.codehaus.org. The system administrator has been notified.

The RemoveTask code is pretty much the same, but it implements Transaction (as it doesn't need to return anything):

An error occurred: cvs.prevayler.codehaus.org. The system administrator has been notified.

In both cases, we have encapsulated the changes to be made to our system into small chunks of reusable code.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.