CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

DataModule and Session

General discussion

by RolphyReyes » 13 May 2014 15:27

Hi.

Thanks for the answer in my previous post.

I have another question, Does CGDevTools has automatic handling of Delphi data modules per session??
RolphyReyes
 
Posts: 5
Joined: 13 May 2014 13:32

by Jorge Sousa » 13 May 2014 15:59

Hello

Does CGDevTools has automatic handling of Delphi data modules per session??


What do you mean? Can you be more specific? t.i.a.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by RolphyReyes » 14 May 2014 13:38

Hi.

Sorry for not be specific.

According to this article http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:1955 of Drs. Bob, wee need to instantiate the DataModule with the Owner UserSession.

So my question is related to that subject. Does CGDevTools manage this for me or I have to do it?


P.S. Sorry for my poor english.
RolphyReyes
 
Posts: 5
Joined: 13 May 2014 13:32

by RolphyReyes » 15 May 2014 13:48

Hi!!!

Any news on this subject???
RolphyReyes
 
Posts: 5
Joined: 13 May 2014 13:32

by Jorge Sousa » 15 May 2014 14:09

Hi

I'm sorry, i started, then i forget to finish.

In fact we don't believe that something should be done to create datamodules for a session.

You just have to create them when the TIWUserSession is created, or later, as long as in the memory space of Session: TIWApplication ownership.

that said, you can call at any time TMyDateModule.Create(WebApplication) or TMyDateModule.Create(UserSession), there is no special requirement.

However you must include the use of unit IWRtlFix, in the .dpr, as it is included by default when creating a new IW application, using the wizard.

I hope it helps.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by RolphyReyes » 15 May 2014 15:01

Hi.

Thanks for answering.

I made this question, because as far as i understand and i don't know if this is correct, if i don't use the IWUserSession as owner of the DataModule when the users interact with the data it can be jeopardize with the change made by the other user.

I don't know if this is correct.

P.S. Sorry for my poor english
RolphyReyes
 
Posts: 5
Joined: 13 May 2014 13:32

by Jorge Sousa » 15 May 2014 15:37

Hi

Ok let me explain you briefly

There is one only instance of TIWServerController, per application, and should only be use for writing only in the main-thread (OnCreate / OnConfig).

Then there are as many sessions as browsers connected, and for each session, a list of IWForms / IWUserSession or Any oher data modules, that are owned

Everytime a request is done, like a button click, you are working in a unique instance of a Session, IWUserSession, IWForm or DataModule.

If you have more sessions opened, there will be another relative instances, so it's perfectly save to write them concurrently.

Another thing, is data pooling, also existent in Intraweb, is DataModulePool, to share the same data between a given number of sessions.

P.S. Sorry for my poor english


You don't have to apologise, we understand you very well, we face the same problem, I hope Shakespeare forgives us all :D
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to General - Archive

cron

Who is online

Users browsing this forum: No registered users and 4 guests

Contact Us.