Hi Axapta experts,
I've got a problem concerning the database log and I hope someone
has some experience with this.

One of our customers running Axapta 3.0 SP3 uses the database log to
track changes to vital data. They generate about 10000 records per
month, keeping the information for at least 6 months. Every 3 or 4 month
the admin wants to delete all record older than this.

To do this, he opens form SysDataBaseLog, clicks the Cleanup button,
enters the appropriate criteria on record creation date and starts the
cleanup process.

Right after clicking OK Axapta displayed an error message saying
"out of memory".

I've debugged class SysDataBaseLogCleanup, not a complicated one,
and found out that the run() method first counts all records that will
be deleted by reading through a query called SysDataBaseLog. The
counting is done just to be able to display a progress bar later while
actually deleting records.

The error occurred while reading through the query.

Furthermore, when looking at the changed fields in tab "History"
of form SysDataBaseLog Axapta sometimes closed without even giving an
error message.

Under debugger control I've got the message (translated from
German):
Error while processing: SysDictField object is not initialized.
Stack-Trace:
\Classes\SysDictField\nullValue
\Data Dictionary\Tables\SysDataBaseLog\Methods\getDataAslist - line 20
\Forms\SysDatabaseLog\Methods\buildContents - line 30
\Forms\SysDatabaseLog\Data Sources\DBHistory\Methods\active - line 7

This is method getDataAsList():

/*
     Returns a list of containers with [fieldId, newValue, oldValue]
*/
list getDataAslist()
{
     list        list = new list(Types::Container);
     int         i;
     fieldId     fieldId;
     SysDictField   DictField;
     container   tmp;

     if (typeOf(conpeek(this.Data, 1)) == Types::Container)   //Version
3.0 format
     {
         for (i=conlen(this.data); i; i--)
         {
             tmp = conpeek(this.Data, i);
             fieldId = conpeek(tmp, 1);
             DictField = new SysDictField(this.table, fieldId);
=>        if (dictField.nullValue() != conpeek(tmp, 2) ||
                 (conlen(tmp) == 3 && dictField.nullValue() !=
conpeek(tmp, 3)))
             {
                 list.addEnd([fieldId, conpeek(tmp, 2), conpeek(tmp,
3)]);
             }
         }
     }
     else                                                    //Earlier
format
     <snip>

     return list;
}
The => mark shows the statement that causes Axapta to crash.

The records in table SysDataBaseLog store changed data in a container
field named "Data". This container contains itself one container
per changed field. The inner container is made up of 3 elements (in
Axapta 3.0), the fieldId, the new field value and the old field value.

Unfortunately, the record causing the error above had 2 inner containers
of which the 2nd was empty. Though I suppose that this record is
malformed, method getDataAsList() is still to blame because it
doesn't care for empty containers or invalid fieldIds. So the crash
was inevitable and gives a good example of Murphy's Law.

Now my questions:
Did someone have this problem before?
Did someone find a solution for it?
Has someone got a clue on how these "defective" log records are
created?

Your help is pretty much appreciated since I'm working on this for
several hours.

Thanx in advance
Alex

Keywords: databaselog, database log, sysdatabaselog,
sysdatabaselogcleanup, container




[Non-text portions of this message have been removed]






YAHOO! GROUPS LINKS




Reply via email to