Error when updating a field in a Shared-Mem-Application
Posted: Tue 01 Oct 2013 12:55
Hello!
I'm want to write a new DLL-based application which has the TUniConnection on the Application.Mainform and the TUniTable (or Query and so on) on a form that resides in a dynamically loaded DLL. The UniConnection on the Mainfrom will be shared via FastMM4 to the DLL. The goal is an data-aware application with a central defined DB connection and some modules that using the existing DB connection to work with the DB.
This works good for a short time: Application starts, creates the child form in the DLL, assigns TUniTable.Connection at Runtime to the object on the Mainform and sets TUniTable.Active to TRUE. The Data from the assigned Table in the Database is displayed correctly in a attached TDBGrid. So i can say, data loading from the DB and the memory sharing between Mainform and DLL-Childform works fine.
But, unfortunately, when i'm edit an Record in the Grid, press Enter and try to change the active record, an Message "Cant assign TUniEncryption to TUniEncryption" appears. The modified data will not be written to the DB and after closing the application, much memory leaks (related to TUniConnection) are reported.
Is this application design generally wrong for UniDAC? Should i use a separate TUniConnection for each DLL-Childform? But in this case, one application instance does open multiple DB sessions. I think, this is not a good design.
Thanks for any suggestion.
Cody
I'm want to write a new DLL-based application which has the TUniConnection on the Application.Mainform and the TUniTable (or Query and so on) on a form that resides in a dynamically loaded DLL. The UniConnection on the Mainfrom will be shared via FastMM4 to the DLL. The goal is an data-aware application with a central defined DB connection and some modules that using the existing DB connection to work with the DB.
This works good for a short time: Application starts, creates the child form in the DLL, assigns TUniTable.Connection at Runtime to the object on the Mainform and sets TUniTable.Active to TRUE. The Data from the assigned Table in the Database is displayed correctly in a attached TDBGrid. So i can say, data loading from the DB and the memory sharing between Mainform and DLL-Childform works fine.
But, unfortunately, when i'm edit an Record in the Grid, press Enter and try to change the active record, an Message "Cant assign TUniEncryption to TUniEncryption" appears. The modified data will not be written to the DB and after closing the application, much memory leaks (related to TUniConnection) are reported.
Is this application design generally wrong for UniDAC? Should i use a separate TUniConnection for each DLL-Childform? But in this case, one application instance does open multiple DB sessions. I think, this is not a good design.
Thanks for any suggestion.
Cody