Koukliatis Posted March 16, 2017 Share Posted March 16, 2017 Hi, I was wondering what is the best efficient way to create a view only announcement form for users. What I want is to show a grid with some data in it to the users who connects. Using a connection and a query to the maindatamodule can accomplish that task, but I will have waste of resources and connections to the database. After all the data will be read only and the same for all. Can I use ServerModule to do that? I mean can I put Connection component and Query Component to the ServerModule (set a Timer or UniThreadTimer to refresh it now and then) and just put a Datasource and a UniDBGrid to MainForm? In that way, I will have only one connection and one cursor to the database, and thousand of users viewing the same data (announcements). Have you ever deal with that kind of situation before? Thanks, Jason. Quote Link to comment Share on other sites More sharing options...
asapltda Posted March 16, 2017 Share Posted March 16, 2017 Hi , try in server module , Quote Link to comment Share on other sites More sharing options...
GerhardV Posted March 16, 2017 Share Posted March 16, 2017 Just make a prototype and use the Stress tool that comes with uniGUI to test it. Quote Link to comment Share on other sites More sharing options...
adragan Posted March 16, 2017 Share Posted March 16, 2017 Try that and you'll get a sharing violation. Connection objects are not sharable between sessions. If you use MySQL then try "the php way" wich means you connect, download data , paint it in a StringGrid or a memory table and close connection. MySQL does connect/disconnect very fast. Firebird /Interbase not so fast. Quote Link to comment Share on other sites More sharing options...
Koukliatis Posted March 16, 2017 Author Share Posted March 16, 2017 Hi , try in server module , Unfortunately adragan is right you cannot use an out-of-session data and share it to sessions. It's not only the sharing violation of the Tconnection components is wrong as architecture. It would be nice though if we could do that. Just make a prototype and use the Stress tool that comes with uniGUI to test it. Yes I've already used the UniGUI's Stress Tool but reducing the payload both in memory and db connections is always nice. Try that and you'll get a sharing violation. Connection objects are not sharable between sessions. If you use MySQL then try "the php way" wich means you connect, download data , paint it in a StringGrid or a memory table and close connection. MySQL does connect/disconnect very fast. Firebird /Interbase not so fast. You have absolutely right about the sharing violation. Having the TDataset in a out-of-session environment (such as ServerModule) won't do the trick. I think a memory table will help reduce the workload on the database but not the memory of the server itself. Thanks for the advice! The DBMS is firebird which has a descent connect/disconnect round-trip but I will tell when the time comes. Unfortunately the only alternative to firebird is Oracle not mySQL. As I said the scope is to have thousands of users connected simultaneously and I'll try my best to prove that UniGUI can support that situation. Will see. Thanks everyone. Quote Link to comment Share on other sites More sharing options...
Harry Rogers Posted March 17, 2017 Share Posted March 17, 2017 If it's read only and potentially thousands of sessions need to view it then one approach that could use minimal resources maybe to create an image of the data you wish to display (draw on a bit map canvas and save it as a jpeg) in an external process and then simply show users the picture? Quote Link to comment Share on other sites More sharing options...
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.