Bernie07 Posted November 23, 2016 Posted November 23, 2016 Hello, we have problems with our database (NexusDB) if we open at the same time in different sessions a table. It seems not thread safe. The tables components are in a TDataModule. Now I have readen that we should use better a TUniDataModule. But where can I find it? In which unit? I havre searched this Forum, but I found no answer. Best wishes Bernhard Quote
NelsonFS Posted November 23, 2016 Posted November 23, 2016 File, New, Other, uniGUI for Delphi, Data Module Quote
Bernie07 Posted November 23, 2016 Author Posted November 23, 2016 But if I do so, I get only a TDataModule instead of TUniDataModule. And then I have the problem that it is not Threadsafe for the NexusDB Tables. So want Change it on source Code for example TDataEinsaetzeAssistent = class(TDataModule) to TDataEinsaetzeAssistent = class(TUniDataModule) But I don't know which unit I have to set in the uses clause. By the way for all uniGUIxxx Units I have not the source Code although we've buyed the product with source Code. We have only the source Code for the components. Best wishes Bernhard Quote
Administrators Farshad Mohajeri Posted November 23, 2016 Administrators Posted November 23, 2016 But if I do so, I get only a TDataModule instead of TUniDataModule. TuniDataModule class does not exist. As NelsonFS stated create them from uniGUI wizard and uniGUI will create a private copy of that module for each session. Quote
Bernie07 Posted November 24, 2016 Author Posted November 24, 2016 Thanks, I have solved my problem and now I understand how it works. There was one DataModule which I've used inside a classic application and in my web application. I don't want two datamodules which do the same Things. But the following changes make the DataModule compatible for the classic application and for the web application : {$IFNDEF ZDWEB}var DataTarifvertragBerechnungen: TDataTarifvertragBerechnungen;{$ENDIF} {$IFDEF ZDWEB}function DataTarifvertragBerechnungen: TDataTarifvertragBerechnungen;{$ENDIF} implementation {$R *.dfm} {$IFDEF ZDWEB}uses UniGUIVars, uniGUIMainModule, MainModule; function DataTarifvertragBerechnungen: TDataTarifvertragBerechnungen;begin Result := TDataTarifvertragBerechnungen(UniMainModule.GetModuleInstance(TDataTarifvertragBerechnungen));end;{$ENDIF} and on the end of the source file : {$IFDEF ZDWEB}initialization RegisterModuleClass(TDataTarifvertragBerechnungen);{$ENDIF} Now it works as it should. Best wishes Bernhard Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.