2

Hopefully I can express this in a coherent and meaningful way:

Two of our DBA's came up to me today after an email I sent explaining why we were using NHibernate and the benefits of an ORM framework. They have been pushing hard for refactoring our stored procs to include instrumentation like this:

BEGIN DBMS_APPLICATION_INFO.set_module(module_name => 'Human Resources' ,action_name => 'Get Employees');

{sql here}

DBMS_APPLICATION_INFO.set_module(NULL, NULL);

My questions really stem around how could we accomplish this, are there any huge caveats that would recommend against finding an implementation for this, if this is too painful, are there alternatives.

Thank you in advance, -sean

4
  • This is a good start in the absence of any other instrumentation, but it is unclear to me where you are considering the calls - PL/SQL stored procedures or Java-side code? Commented Jul 20, 2010 at 0:09
  • That's the problem, the dba's would like the instrumentation to be on the database side but we're not using stored procs, just NHibernate's generated SQL. Can we add the instrumentation to the NHibernate SQL? Commented Jul 21, 2010 at 14:21
  • 1
    Don't know how it fits in with NHibernate (and that's why I'd like to see an example), but the ODP documentation has Module/Action in as Connection properties download.oracle.com/docs/html/E15167_01/… Commented Jul 22, 2010 at 4:46
  • I can't actually give any examples as I'm trying to figure it out but it would basically be like asking NHibernate to prepend and append calls to DBMS_APPLICATION_INFO.set_module before it does anything with the underlying datastore. Commented Aug 4, 2010 at 18:51

1 Answer 1

0

Seems like what you need is auditing? Maybe Data Auditing in NHibernate and SqlServer and http://www.shawnduggan.com/?p=89 can help you out

Sign up to request clarification or add additional context in comments.

1 Comment

This is definitely heading in the right direction. The event api in NHibernate might just be what they are asking for. I will post what I find after some more experimentation. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.