Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1636

Re: Subclassing DbServer for auditing

From "Geoff Schaller" <geoffx@softwarexobjectives.com.au>
Subject Re: Subclassing DbServer for auditing
Date 2011-07-07 22:15 +0000
Newsgroups comp.lang.clipper.visual-objects
References <e23586a3-110a-4a76-afcc-1cac477c5961@y13g2000yqy.googlegroups.com>
Message-ID <4e16301d$0$2136$c30e37c6@exi-reader.telstra.net> (permalink)

Show all headers | View raw


Nick,

You are pushing shit up hill. The only solution to your specifications 
is to subclass the DBServer class and trap every commit. You could 
certainly break into the Optimisticflush method (because it knows which 
fields where changed in the row it is updating) but be aware this audit 
file will scale to many times the size your original DBF. Very quickly. 
And it will be a significant performance impact.

But I have to say, this is where you should be using SQL.
This alone is worth the conversion.

Using triggers you can completely audit every event and transaction in 
your table system. With very little code impact and very low performance 
overhead.

Sorry, but SQL is just the way to go.

Geoff



"Nick Friend" <nicktekhne@googlemail.com> wrote in message 
news:e23586a3-110a-4a76-afcc-1cac477c5961@y13g2000yqy.googlegroups.com:

> Hi all,
>
> I need to retrofit a detailed auditing system to our application
> (DBFCDX), and am looking for input...
>
> We need to keep a register of changes at the record level, so for
> instance if a user enters an editing screen and changes several fields
> on one record, we should create a single register in the audit trail -
> that register could either hold all the old field values and all the
> new field values, or just the before and after values of fields that
> have actually changed. The important thing is that it's a single audit
> register for multiple field changes, not one audit record per field
> changed.
>
> I'm thinking the following at the moment (all in sub-classed
> DbServer)..
>
> In Append or Recall - set audit mode to "Create".
> In Delete - backup all existing field values and set audit mode to
> "Delete"
> In FieldPut - if not already in audit "Create" or "Update" mode, then
> must be modifying, so backup all existing fields and set audit mode to
> "Update". If already in "Create" or "Update" mode, then don't need to
> do anything.
>
> In Unlock, Commit, Close, Skip, Goto, GoTop, GoBottom, Seek, Locate,
> Continue - if in Create/Update/Delete mode, then complete audit of
> record, backup all new field values and create audit register.
>
> Some of this processing could probably be done in Notify, but looking
> at the available Notify events there are some actions that aren't
> really covered (eg. Recall) so it seems safer to handle it in the
> individual methods.
>
> Critical features are 1) registering changes at the record level (ie
> grouping a single set of field changes to a record together), and 2)
> obviously every database change must be caught and recorded.
>
> Any thoughts/experiences?
>
> TIA
>
> Nick

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Subclassing DbServer for auditing Nick Friend <nicktekhne@googlemail.com> - 2011-07-07 01:16 -0700
  Re: Subclassing DbServer for auditing "richard.townsendrose" <richard.townsendrose@gmail.com> - 2011-07-07 01:29 -0700
    Re: Subclassing DbServer for auditing Nick Friend <nicktekhne@googlemail.com> - 2011-07-07 01:56 -0700
  Re: Subclassing DbServer for auditing "Simon Goodman" <simon.spam@spam.abersoftware.co.uk> - 2011-07-07 13:25 +0100
  Re: Subclassing DbServer for auditing dlzc <dlzc1@cox.net> - 2011-07-07 09:01 -0700
    Re: Subclassing DbServer for auditing Nick Friend <nicktekhne@googlemail.com> - 2011-07-07 09:47 -0700
      Re: Subclassing DbServer for auditing dlzc <dlzc1@cox.net> - 2011-07-07 12:39 -0700
  Re: Subclassing DbServer for auditing "Geoff Schaller" <geoffx@softwarexobjectives.com.au> - 2011-07-07 22:15 +0000
    Re: Subclassing DbServer for auditing Nick Friend <nicktekhne@googlemail.com> - 2011-07-08 01:31 -0700
  Re: Subclassing DbServer for auditing Amilcar A. Camargo <amilcarcamargo@gmail.com> - 2011-07-07 17:33 -0600
    Re: Subclassing DbServer for auditing Nick Friend <nicktekhne@googlemail.com> - 2011-07-08 01:38 -0700
      Re: Subclassing DbServer for auditing dlzc <dlzc1@cox.net> - 2011-07-08 10:28 -0700
        Re: Subclassing DbServer for auditing "richard.townsendrose" <richard.townsendrose@gmail.com> - 2011-07-16 03:50 -0700
          Re: Subclassing DbServer for auditing Nick Friend <nicktekhne@googlemail.com> - 2011-07-18 00:24 -0700
            Re: Subclassing DbServer for auditing Benito Fernández <bfernandezm@prodigy.net.mx> - 2011-07-18 14:13 -0500
            Re: Subclassing DbServer for auditing Karl Faller <k.faller_withoutthat_@onlinehome.de> - 2011-07-18 21:17 +0200
            Re: Subclassing DbServer for auditing dengler <dewo001@hotmail.com> - 2011-07-20 21:29 +0200
              Re: Subclassing DbServer for auditing Nick Friend <nicktekhne@googlemail.com> - 2011-07-20 13:38 -0700

csiph-web