To me this looks like a major bug (some will call it a feature...) !!!
 
Regards
Paul McKenzie
Analyst Programmer
SMSS Ltd.
 
----- Original Message -----
Sent: Friday, February 20, 2004 2:05 PM
Subject: RE: [DUG] Child Remote DataModules Threading

You have the general Delphi Streaming issue/error.
 
There is no change in D7.
 
It is a namespace error. The simplest solution is to write code to connect up your stuff manually. I.e. Do not rely on the streaming mechanism to get it correct.
 
Delphi is built in this way to rely on singletons or put another way, that there will at most ever be one occurrence of a form/data module - as far as the streaming is concerned. Any cross form linking will have this issue.
 
Myles.
-----Original Message-----
From: Paul Mckenzie [mailto:[EMAIL PROTECTED]
Sent: Friday, 20 February 2004 14:02
To: Delphi List - Delphi
Subject: [DUG] Child Remote DataModules Threading

Hi.
  I have the following application :
 
  Delphi 6, Ibx6.08. Client server application. Dcom Connection.
 
The Server is setup :
  1) Main Remote data module(rdmMain), with a TibDatabase and TIbTransaction. ciMultiInstance, tmApartment.
  2) Many child remote data modules. They have IbQueries pointing( at design time ) to the TIbDatabase
     of the main remote data module(rdmMain). ciInternal, tmApartment.
 
  According to the documentation, as the child remote data modules are internal, they can only be seen by
  the thread that created them.
 
 When I try to run this application, and connect multiple clients to the same app server, the program crashes.
 
 The problem (I think) is :
 
  1) When first client connects, one rdmMain is created( and added to the Screen global variable in
     Screen.DataModules as "MainRdm").
     When child rdms are read from the stream, the TibQueries read their database properties and set it
      to point to "MainRdm.Database").
 
  2) When the second client connects, another rdmMain is created( and added to the Screen global variable in
     Screen.DataModules as "MainRdm_1" -> changes the name ).
     When child rdms are read from the stream, the TibQueries read their database properties and set it
      to point to "MainRdm.Database", NOT "MainRdm_1").
 
  So, I end up with queries in the second COM object looking at a database in the first COM object. Which,
in theory, should be running in a different thread.
 
  Now, I already know a work around( setting the tibdatabase when the rdm is created ). What I'd like to know is :
 
  1) Is the way the Delphi code works correct ? Has it been changed in Delphi 7 or 8 ( ie : does the global list of
  datamodules consider which thread they are created in )?
 
  2) Are there any other things that will be global to all of the com objects created ? The "main" form comes to
   mind, is there anything else ? Which is the code that has to be made thread safe ?
 
 Thanks very much for the info
 
Regards
Paul McKenzie
Analyst Programmer
SMSS Ltd.
 


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to