IT tutorials
 
Technology
 

Microsoft Dynamic AX 2009 : The Database Layer - Database Access (part 3) - Database Log and Alerts

8/27/2013 3:57:50 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

5. Dynamics AX Type System vs. Database Type System

Because Dynamics AX application table definitions are the master for the table definitions in the database, the Dynamics AX application runtime also explicitly controls the mapping between the Dynamics AX data types and types in the supported databases. Table 2 describes the mapping between the Dynamics AX type system and the database type system. The Dynamics AX application runtime doesn’t support database types not shown in this table.

Table 2. Dynamics AX and Database Type Systems
Dynamics AXSQL Server 2005SQL Server 2008Oracle Database 10g
intINTINTNUMBER(10,0)
realNUMERIC(28,12)NUMERIC(28,12)NUMBER(32,16)
string (fixed length)NVARCHAR(length)NVARCHAR(length)NVARCHAR2(length)
string(memo)NTEXTNTEXTNCLOB
dateDATETIMEDATETIMEDATE
timeINTINTNUMBER(10,0)
utcdatetimeDATETIMEDATETIMEDATE
enumINTINTNUMBER(10,0)
containerIMAGEIMAGEBLOB
guidUNIQUEIDENTIFIERUNIQUEIDENTIFIERRAW(16)
int64BIGINTBIGINTNUMBER(20,0)

6. Database Log and Alerts

Dynamics AX includes two features that base their functionality on the fact that data has been manipulated in tables: the database log and alerts. Both features use information the Dynamics AX application runtime exposes when specific data is manipulated and when the application runtime uses configuration data entered into a Dynamics AX framework table from the application. The configuration that identifies which statements to trace and log is stored in the Databaselog table provided by the application runtime. When a statement that should be traced and logged is executed, the application is notified by executing a callback method on the Application class.

Figure 3 illustrates a scenario in which Dynamics AX is configured to log updates to custTable records. When the custTable.update method is called, it invokes the base version of the update method on the xrecord object by calling super. The base version method determines whether database logging has been configured for the given table and the update statement by querying the Databaselog table. If logging is enabled, a call is made to the logUpdate method on the Application object, and the X++ application logic inserts a record into the SysDataBaseLog table.

Figure 3. Logging database updates


The scenario is the same for inserts, deletes, and renaming of the primary key as well as for raising events that triggers alerts.

You can use the application runtime table Databaselog to configure all the logging and events because it contains a logType field of type DatabaseLogType, which is an enumeration that contains the following four values for the database log feature: Insert, Delete, Update, and RenameKey. It also contains the following four values for alerts: EventInsert, EventDelete, EventUpdate, and EventRenameKey. When the application runtime queries the Databaselog table, it therefore queries for the configuration of a specific type of logging on a given table.

Table 3 shows the correlation between the database log and alert configuration. It shows what triggers the log or event, which method on Application the callback is made to, and to which table the log or event is logged.

Table 3. Database Log and Alert Implementation Details
Logged EventTriggering Method on Xrecord ClassCallback Method on Application ClassWhere Logged
Database insertinsertlogInsertSysDataBaseLog
Database updateupdatelogUpdateSysDataBaseLog
Database deletedeletelogDeleteSysDataBaseLog
Database rename primary keyrenamePrimaryKeylogRenameKeySysDataBaseLog
Insert eventinserteventInsertEventCUD
Update eventupdateeventUpdateEventCUD
Delete eventdeleteeventDeleteEventCUD
Rename primary key eventrenamePrimaryKeyeventRenameKeyEventCUD

Note

The application runtime doesn’t query the Databaselog table in the database every time a trigger method is executed because the AOS caches all records in memory when first needed. When records are changed in the Databaselog table, the cached version must be flushed. To flush the cache, call SysFlushDatabaseLogSetup::main from X++, which not only flushes the cached memory on the current AOS but also informs other AOSs that they should flush their caches as well. The other AOSs read the flushed information from the database at predefined intervals, so they are flushed with minor delays.

 
Others
 
- Microsoft Dynamic AX 2009 : The Database Layer - Database Access (part 2) - Left and Right Justification , Placeholders and Literals
- Microsoft Dynamic AX 2009 : The Database Layer - Database Access (part 1) - Database Synchronization
- Scripting Windows Home Server : Programming Objects - Working with Object Properties, Working with Object Collections
- Scripting Windows Home Server : Running Scripts - Using WScript for Windows-Based Scripts, Script Properties and .wsh Files
- Windows Server 2008 : Configuring an IPv6 Address with netsh, Disabling IPv6 in Windows Server 2008
- Windows Server 2008 : Configuring IPv4 with netsh
- Windows Server 2008 : Understanding netsh, Understanding netsh Contexts
- Windows 7 : Faxing and Scanning - Setting Up Your Cover Sheets
- Windows 7 : Faxing and Scanning - Defining Dialing Rules
- Windows 7 : What You Need for Fax - Configuring fax modem options
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us