Quote:
All of the above needs to rollback if any of the logging fails. I think most of the solutions can't guarantee that all the logging and all the changes will rollback because they advocate creating a new transaction to do the logging.
If you want everything to roll back if Auditing fails than you have to do the audit stuff in the same transaction.
All the solutions advocate creating a new transaction to do the logging as Logging is just the side task and you would not want your Business Logic changes to roll back because of some logging did not occurred properly.
Its just the requirement thing,if in your case Auditing is very critical than do it in same transaction and hibernate will take care of Rollbacks in any failure condition.