Auditing - how to get a value from a lookup table

Posts   
 
    
Posts: 5
Joined: 08-Mar-2004
# Posted on: 09-Sep-2009 04:49:20   

I'm using LLBLGen 2.5 (Adapter) with .Net 2.0 and implementing some auditing. Most of it is working, except for auditing fields that are just INT's pointing to the PK (identity) in some other lookup table. I am auditing old/new values into my own custom table, so when I try to audit one of these fields, I really need to go off and do a query to lookup the descriptive values for both the old/new INT values.

Its not an option to cache all the possible values in memory - there are far to many of them and they change frequently.

Any ideas?

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 09-Sep-2009 12:12:07   

I guess you'll have to query the database within your auditor to fetch the descriptive information you need for these lookup tables.

Posts: 5
Joined: 08-Mar-2004
# Posted on: 09-Sep-2009 13:49:15   

Ideally I'd like to have access to the adapter, or at least the connection string, inside the auditor. I don't want to add a reference to my business logic layer from inside my data access layer, because then I'd have a circular reference.

Is there any way to access the adapter used to fetch an entity from an executing auditor? Or any way to attach/inject the adapter or connection info?

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 09-Sep-2009 19:17:28   

I don't see a reason to use the same adapter or the same connection. You should use an adapter in your Auditor, and it will get the connection string from the bconfig file of your application at runtime.