The is the step I done to your failover demo of the latest MyDAC version :
1. Setup the connection info of Data.Connection
2. Run the program
3. Enable Pooling
4. Open Tables
5. Make some modification.
6. Stop and restart MySQL server
7. Apply update
Then it will have below expected exception :
Project FailOver.exe raised exception class EMySqlException with message 'Lost connection to MySQL server during query'.
Followed by an unexpected AV exception :
Access violation at address 75D73F6D in module 'KERNELBASE.dll'. Read of address 0194F000.
It located at the Mainform ConnectionConnectionLost procedure when accessing Component.Name
When in disconnected mode, running FieldDefs.Update will make the connection constantly connected! Is it the planned effect? I need to run that command so that I can create the fields so that I can add in other lookup and calculated fields in runtime based on user setting. However, I still want the connection in disconnect mode because the network is not so stable. How to achieve this?
Failover demo error and disconnetedmode question.
I added a refresh button in the failover application which refresh the two table.
Then I repeat the former operation except the applyupdate is replaced by the refresh.
It show another error
Project FailOver.exe raised exception class EAssertionFailed with message 'Assertion failure (D:\D2010\Libs\mydac\Source\MyClasses.pas, line 3382)'.
It also close the table which refreshed.
I encounter similar issues in my much more complicated application.
Then I repeat the former operation except the applyupdate is replaced by the refresh.
It show another error
Project FailOver.exe raised exception class EAssertionFailed with message 'Assertion failure (D:\D2010\Libs\mydac\Source\MyClasses.pas, line 3382)'.
It also close the table which refreshed.
I encounter similar issues in my much more complicated application.
-
AndreyZ
Thank you!
I encountered further related problem as follow :
After I changed to Disconnected Mode, Some area using ExecSQL which have no problem before now got random exception in either
1. Assertion failure in Line 2257 in MyClasses.pas
or
2. AV in Line 2258 in MyClasses.pas
My procedure just call ExecSQL to update a table in the server, then may or may not do some modification to TMyQueries and do an apply update. The user can do the procedure again again base on same / different records.
The Call Stack is
My Proceduer call
TCustomMyConnection.ExecSQL
TCustomDAConnection.InternalDisconnect
TCustomDAConnection.Disconnect
TCustomDAConnection.SetConnected(False)
TCustomConnection.SendConnectEvent(False)
TDAMetaData.ConnectChange
TMySQLRecordset.Disconnect
TMySQLRecordset.GetIsClient41
TMSQLConnection.GetIsClient41
Please note that it do not happen all the time and I had never encounter error in the first run by now. From the 2nd time up, it sometime run without problem and sometime with AV. Even after AV, the next time might still work. Then sometime the assertion exception shown and after that, it will always have assertion exception.
#Edit :
I just made a modification from
TMyQuery.ApplyUpdate
to
TMyConnection.ApplyUpdate
and this problem seems to gone away. So I think it is the TMyQuery.ApplyUpdate that mess up the thing.
I encountered further related problem as follow :
After I changed to Disconnected Mode, Some area using ExecSQL which have no problem before now got random exception in either
1. Assertion failure in Line 2257 in MyClasses.pas
or
2. AV in Line 2258 in MyClasses.pas
My procedure just call ExecSQL to update a table in the server, then may or may not do some modification to TMyQueries and do an apply update. The user can do the procedure again again base on same / different records.
The Call Stack is
My Proceduer call
TCustomMyConnection.ExecSQL
TCustomDAConnection.InternalDisconnect
TCustomDAConnection.Disconnect
TCustomDAConnection.SetConnected(False)
TCustomConnection.SendConnectEvent(False)
TDAMetaData.ConnectChange
TMySQLRecordset.Disconnect
TMySQLRecordset.GetIsClient41
TMSQLConnection.GetIsClient41
Please note that it do not happen all the time and I had never encounter error in the first run by now. From the 2nd time up, it sometime run without problem and sometime with AV. Even after AV, the next time might still work. Then sometime the assertion exception shown and after that, it will always have assertion exception.
#Edit :
I just made a modification from
TMyQuery.ApplyUpdate
to
TMyConnection.ApplyUpdate
and this problem seems to gone away. So I think it is the TMyQuery.ApplyUpdate that mess up the thing.