Jump to content

TUniDataModule where can I find it?


Bernie07
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...