Our application has the following audit strategy: every table has a mirror "history" table with two additional columns - "ID_USER" and "TIMESTAMP". Every INSERT/UPDATE/DELETE operation starts a trigger which inserts a new record in the history table, so that we have a full audit log of who does what when.
The problem is that the trigger does not know who is currently logged in within J2EE. Any recommendations about how to achieve that with Hibernate? Should we try our own impl of hibenate's Interceptor, or should we seek a way to somehow pass transaction-scope variables though JDBC... ? Augmenting the persistent classes with an additional property is not preferable.