Jump to content

What is the best way to show read only dataset result to users


Koukliatis

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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? 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...