In your scenario are you adding the additional audit info to each record save via your base class? or calling a seperate sproc for each change.
The base BO first calls an audit sproc with the extra info (user name, comments, etc.) and gets back an audit ID. It creates an audit record with the extra info. Then the old values sproc is called, passing it the audit ID, the table and ID of record being changed. It creates a set of audit field records (one record for every field being changed), with the old values. Then the BO does the actual save. Finally, the new values sproc is called with the audit ID, table and ID of changed record. It adds the old values to the audit field records created by the new value sproc.
What kind of performance hit do you take, what is your volume like?
Haven't found any performance hit. Almost all the work is done on SQL Sever, as the base BO is only calling sprocs with small sets of data. My app is very text based. Lots of TEXT fields (oh the joy...eventually we'll upgrade to SQL 2005 and can use varchar(max)). This method allows for field level auditing while only sending one set of the actual table data to the server at a time. Our volume is low, but most users are remote with varying connections. So I was more concerned with limiting bandwidth requirements than server issues.
I was headed down the road I was so that I could update the values once on the server, only having to pass the audit fields not in the tables once, or when a new user logs into the system/feature, from there everything would be on the SQL Server.
I wasn't quite clear on how the CONTEXT_INFO worked. You can set do the SET CONTEXT_INFO just once in SF and then it keeps working during that entire session? If so, that is cool.
I'm going to look into this some more myself, though I think in my specific circumstance it might not work....