Jul 19, 2010

Working around envers

When using envers for in our implementation, on the simplistic implementation, it does not provide much information on what the transaction is about. To get around this, we had no choice but to input the transactional information at the action level. This will also allow all information to be in a transaction table, in this case the "MA_Transaction".

The transaction table shall also be audited to tag the revision number to it, when envers audits it. This finally "MA_Transaction_AUD" table will contain the revision + Transaction, giving a consolidated table of all transaction information.


The key thing to note is that both the entity persistence and the transaction persistence have to be done within one transaction to ensure that the revision is properly replicated in the "MA_Transaction_AUD" table.

Though, this design is not a clean and straightfoward one, this was necessary to get this it working the way we need to, when we were supposed develop an enquiry facility.

No comments: