-
1. Re: How to identify user editing the database (the application user) ?
wdfink Jun 8, 2014 7:46 AM (in response to fuinhaazul)Not sure whether I understand the question correct.
I've had implemented extra columns which contain the user and change date.
The JPA objects are set these informations automaticaly on every change.
-
2. Re: How to identify user editing the database (the application user) ?
jaikiran Jun 8, 2014 11:20 PM (in response to fuinhaazul)There was a similar question asked in one another forum recently and some members suggested using an interceptor to keep track of who the logged in user is http://www.coderanch.com/t/633774/Servlets/java/clean-log-database-operation-issued. Perhaps that might help? If not, tell us bit more about your application.
-
3. Re: How to identify user editing the database (the application user) ?
fuinhaazul Jun 10, 2014 5:03 PM (in response to jaikiran)I've had implemented extra columns which contain the user and change date.
The JPA objects are set these informations automaticaly on every change.
Yes. but when the user delete some row, how to know who? and another question. Who is calling stored procedure XXX right now?
jaikiran pai escreveu:
There was a similar question asked in one another forum recently and some members suggested using an interceptor to keep track of who the logged in user is http://www.coderanch.com/t/633774/Servlets/java/clean-log-database-operation-issued. Perhaps that might help? If not, tell us bit more about your application.
jaikiran: Funny thing. The way they sugested on this link is exactly what i was doing to workaround the issue. In my case i was using an EJB interceptor to always call some database specific function that set the current user (in v$session for oracle). Also I used this approach to create a schema based multi tenancy. Based on some rules i managed to create the user principal with relevant informations and then call a "set schema" function that points me to the right database schema.
Is there a better way for doing this? I found out "Oracle proxies" but the examples was only for Oracle ADF that have "ADFContext". (https://blogs.oracle.com/imc/entry/how_to_use_database_proxy) .
-
4. Re: How to identify user editing the database (the application user) ?
fuinhaazul Jun 16, 2014 3:34 PM (in response to jaikiran)Jaikiran, do you know if this is the right way? Maybe there is something especific for do that?
Thanks.