Jump to content

TUniDataModule where can I find it?


Bernie07

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...