KingOrmon Posted September 19, 2014 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 ¿? Quote
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators 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. Quote
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Posted September 19, 2014 Of course, same data will be shared because all of your Datasets are pointing to same database table. Quote
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Posted September 19, 2014 What do you mean by "data contamination"? Quote
KingOrmon Posted September 19, 2014 Author 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 Quote
KingOrmon Posted September 19, 2014 Author Posted September 19, 2014 how can I force clean session always when page load / reload ? Quote
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Posted September 19, 2014 What is schema1? A database? Quote
ZigZig Posted September 19, 2014 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". Quote
KingOrmon Posted September 19, 2014 Author Posted September 19, 2014 The problem could be fastreport fsGlobalUnit, it is shared ? o created new with each session ? Quote
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Posted September 19, 2014 What is the exact issue you are experiencing with your data tables? Quote
KingOrmon Posted September 19, 2014 Author 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)); Quote
ZigZig Posted September 19, 2014 Posted September 19, 2014 Where does this script run? I mean: in which unit is this for-loop ? Quote
Sherzod Posted September 19, 2014 Posted September 19, 2014 Hi KingOrmon.Create and use the unit DataModule for DataSets ... Sorry if I do not understand the question. Best regards. Quote
ZigZig Posted September 19, 2014 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? Quote
KingOrmon Posted September 19, 2014 Author Posted September 19, 2014 fsGlobalUnit is fast-report global var for scripting. it is created when you use fsGlobalUnit() Quote
ZigZig Posted September 19, 2014 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! Quote
Administrators Farshad Mohajeri Posted September 19, 2014 Administrators Posted September 19, 2014 It seems that FastReports keeps a global cache for datasets. There must be a way to disable it. Quote
KingOrmon Posted September 20, 2014 Author Posted September 20, 2014 solved without use fsGlobalUnit Quote
Administrators Farshad Mohajeri Posted September 20, 2014 Administrators Posted September 20, 2014 great. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.