Icon View Incident Report

Serious Serious
Reported By: Peter Crain
Reported On: 3/8/2010
For: Version 2.03 Build 9
# 3173 RENAME TABLE Statement Can Cause AV Later During Execution

I have a problem in closing the Engine that lives in a data module of my app. I thought it reasonable to Close the engine in the OnDestroy method of the DataModule, but it gives a resounding AV when I try it. The code is below.


I had been simply calling the EDBEngine1.Close, and letting it worry about the other components downstream, but I added the other lines when the AV started. This happens after a long migration & database creation process, so I must be destroying something that the Session expects to find, but I cannot see what.

The call stack shows SetConnected after TEDBSession.Destroy, but I don't have the sorce so I can only assume that that is the way it should be:

Access violation at address 005E414B in module 'Ver8NewData.exe'. Read of address 00000000.

TEDBSession.InternalDisconnect
TEDBSession.SetConnected
TEDBSession.Destroy
TComponent.DestroyComponents
TComponent.Destroy
TDataModule.Destroy
TComponent.DestroyComponents
DoneApplication
DoExitProc
@Halt0
initialization

I tried closing the Engine in the form that calls the DataModule - same AV.

procedure TDModule.DataModuleDestroy(Sender: TObject);
var i: integer;
begin
for i := 0 to EDBDatabase1.DataSetCount-1 do
EDBDatabase1.Datasets[i].Close;

for i := 0 to EDBDatabase2.DataSetCount-1 do
EDBDatabase2.Datasets[i].Close;

for i := 0 to EDBSession1.DatabaseCount - 1 do
EDBSession1.Databases[i].Close; // wasn't closing Configuration database

EDBSession1.DropConnections;
EDBSession1.Close; // AV here, or if I rem this line, the AV on next line

EDBEngine1.Close;
end;



Comments Comments
EDB isn't properly re-organizing the internal sorted list of table managers when a table is renamed, so it starts to lose track of certain table managers and doesn't free them properly. Sometimes it doesn't matter, but sometimes it causes things to blow up, and is mainly dependent upon what random junk is in memory. That's why sometimes the error occurs, and sometimes it doesn't.


Resolution Resolution
Fixed Problem on 3/23/2010 in version 2.03 build 10


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image