TIWADVWEBGID Thread safe ?

Hi All,

When testing my application with multiple users, there is a problem somewhere:

I'm using ADO DBConnection to connect to a MS SQL Db, and ADOQuery to select records, and are manually moving data from the query result fields, to grid cells (not using the DBaeare grid). So populating the grid dynamically based on the result of a select statement.

When one user in on, everything is fine. When two user are trying the same select (with different where values), the results gets mixed up, if both activates the query at the same time. If there are 2-3 second between, everything is ok. Typically user1 gets nothing and user2 gets the result of user1's select.

I've been going through my code and changed it to only use UserSession for both vars and ADO components, and server controller.cominitialization is set to Multithreadded, but still I have the problem.

Do I need to do anything special in relation to the TIwAdvWebGrid in this context ? Is the grid it self thread safe ?



I would expect the ADODBConnection to handle this. The TIWAdvWebGrid is only displaying the result of the query and has no influence on the connection.
Do you see different results when, for example, using a default IntraWeb component like TIWGrid?
Hi Bart,

thanks for your reply. No, but then again I have not tried with other grids. But I knew from start it is not the tmsgrid creating problems, it was just a standard question, in case I would start use threads in my application, which I was considering due to the problem i had.

The problem I had was that multiple users got the same result, displayed in their grid, and after some trial and error testing, I found the reason to be a var, holding the select statement, being defined outside the IW Form Class def, and as such a non-safe var. I did not see that until too late.

But my question about the tmsgrid was only for information purposes. There are so many properties to set, and though most, if not all, are described in the manual, it's still a tough task to get to know the result of all the possible combinations.

So I just wanted to know if you could mention those properties, if any, which would have any influence on thread safe programming.


Please note that there is no built-in functionality available in the TIWAdvWebGrid related to threading.
This should most likely be handled on application level.