|
<< Click to Display Table of Contents >> Navigation: Forum > UserSession and Datasets |
01-25-2019, 02:59 PM:
Hello,
I recall some time in the past a post recommending that when utilizing data sets on user connection that is advised to reconnect the dataset to the db connection used in the usersession. I no longer put datasets on forms. I have never had any issue with apps I have developed, though I am always setting the db connection parameters when each session is being created, but leave all of the design time connections in place. Anyway, I am currently working on app that may have hundreds of users I was just thinking if this was the recommended practice or am I good to keep doing the same as I always have done.
Thanks for listening.
Cheers!
01-25-2019, 06:18 PM:
When I first started IW development (back in the days of version 9) I made the mistake of having a dataset on a form, which resulted in users "seeing" other user's data! Since then I have always had the database connection and datasets on the UserSession. I have done both, as in a lot of datasets on the UserSession that a form opens / closes as necessary. In recent years I have mostly had a form call an appropriate UserSession function(s) that reads / writes the data for the form. I have found this easier to maintain than looking at a UserSession that has 20 - 30 datasets on it!
01-25-2019, 07:38 PM:
Hi,
At runtime you should reset (that is re-apply) the dataset connection in the BeforeOpen event of each dataset.
I do this now as a matter of course on all forms, frames, data modules and user session units.
Have not had an issue since implementing this approach.
Best regards,
01-26-2019, 05:42 PM:
Thanks. I am going to implement a generic Before Open event. This will help as I plan tosupport option of having a multi-tenant or single tenant database depending on support level required.
Cheers!