KingOrmon Posted September 19, 2014 Share Posted September 19, 2014 Hello Farshad, I have a serious problem with sessions. I am noticed that TDataSet created in mainmodule are sharing by different sessions. Causing a data contamination from other user/sessions. For each TDataSet on mainmodule I need a different session. Could you tell about this ¿? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Share Posted September 19, 2014 A TDateSet placed on mainModule is never shared among sessions. When you put it on MainModule for each session a new copy is created. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Share Posted September 19, 2014 Of course, same data will be shared because all of your Datasets are pointing to same database table. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Share Posted September 19, 2014 What do you mean by "data contamination"? Link to comment Share on other sites More sharing options...
KingOrmon Posted September 19, 2014 Author Share Posted September 19, 2014 Data contamination from other user tables. It is a big database divided in various schemas data contamination refers for example using schema1.Customers retrieves data from schema2.Customers Link to comment Share on other sites More sharing options...
KingOrmon Posted September 19, 2014 Author Share Posted September 19, 2014 how can I force clean session always when page load / reload ? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Share Posted September 19, 2014 What is schema1? A database? Link to comment Share on other sites More sharing options...
ZigZig Posted September 19, 2014 Share Posted September 19, 2014 Dear KingOrmon, IMHO, that is more a question of cursor location or lock type on your DataSet, than a "serious problem with Sessions". Link to comment Share on other sites More sharing options...
KingOrmon Posted September 19, 2014 Author Share Posted September 19, 2014 The problem could be fastreport fsGlobalUnit, it is shared ? o created new with each session ? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Share Posted September 19, 2014 What is the exact issue you are experiencing with your data tables? Link to comment Share on other sites More sharing options...
KingOrmon Posted September 19, 2014 Author Share Posted September 19, 2014 Sorry, the problem I think that is in fscript using global var fsGlobalUnit. It contains a reference of all dataset in main module. fsGlobalUnit is created once, I believe... then DataSets are sharing into diferent sessions. for i := 0 to ComponentCount - 1 do if Components.ClassNameIs('TADQuery') then fsGlobalUnit.AddObject(Components.Name, TADQuery(Components)); Link to comment Share on other sites More sharing options...
ZigZig Posted September 19, 2014 Share Posted September 19, 2014 Where does this script run? I mean: in which unit is this for-loop ? Link to comment Share on other sites More sharing options...
Sherzod Posted September 19, 2014 Share Posted September 19, 2014 Hi KingOrmon.Create and use the unit DataModule for DataSets ... Sorry if I do not understand the question. Best regards. Link to comment Share on other sites More sharing options...
KingOrmon Posted September 19, 2014 Author Share Posted September 19, 2014 on mainmodule.create runs Link to comment Share on other sites More sharing options...
ZigZig Posted September 19, 2014 Share Posted September 19, 2014 OK so if I understand your code, fsGlobalUnit is a global variable created on ServerModule and shared into each MainModule session. Is it right? Link to comment Share on other sites More sharing options...
KingOrmon Posted September 19, 2014 Author Share Posted September 19, 2014 fsGlobalUnit is fast-report global var for scripting. it is created when you use fsGlobalUnit() Link to comment Share on other sites More sharing options...
ZigZig Posted September 19, 2014 Share Posted September 19, 2014 if fsGlobalUnit is not a session variable, maybe you should rename this topic... There is no problem at all with sessions! Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Share Posted September 19, 2014 It seems that FastReports keeps a global cache for datasets. There must be a way to disable it. Link to comment Share on other sites More sharing options...
KingOrmon Posted September 20, 2014 Author Share Posted September 20, 2014 solved without use fsGlobalUnit Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 20, 2014 Administrators Share Posted September 20, 2014 great. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now