Java Audit table logging, MySQL equivalent of CONTEXT_INFO.

Posted by Julia on Stack Overflow See other posts from Stack Overflow or by Julia
Published on 2010-03-31T10:51:24Z Indexed on 2010/03/31 10:53 UTC
Read the original article Hit count: 568

Filed under:
|
|
|
|

Hi,

I am looking for the MySQL equivalent of CONTEXT_INFO that is present in SQL Server. Or any other session variable like thing using which I can pass the username to the trigger.

I am currently working on logging table data for audit. I need to pass the username of the logged in user to the delete trigger.

Any ideas? We are deleting the rows from the table in a few cases and marking them as deleted in others.

Any alternate solutions are welcome. I thought of using AOP but it could prove problematic when deleting a cascade. I want to look into Hibernate Interceptors, not sure at this point if that works.

If I can find the MySQL equivalent of CONTEXT_INFO, my job is done and elegant as well.

Thanks,

Julia.

© Stack Overflow or respective owner

Related posts about java

Related posts about mysql