0
votes

I have written an application which uses a Datasnap Server over TCP installed as a windows service, and a VCL Winform client using Delphi 2010. The server application is connecting to a SQL Server 2008 instance on the same box. Everything works fine and dandy when I have one user logged in, as soon as a second user connects they both start to get program not responding. I thought that the problem may be a bottle neck in some queries in SQL but I have run a trace all day long and do not see any problems. I subsequently found that an older version of the midas.dll was installed, so I updated that to a later version. But still no joy. I am not sure where to start looking for the problem. I used Bob Swart's Data how you want it white paper as my guide to producing a Datasnap Server and Client, and on a smaller implementation it seemed to work fine. Any pointers on where to start looking would be very much appreciated, before I revert the application back to a thick client and rewriting the server as a .net WCF service using Entity Framework etc etc.

1
Is there a particular call which hangs, or is the connection itself? What did you found while debugging your server?jachguate
No particular I am told. I am going to create a client app which I will be able to run multiple instances of via different VMs. This will make calls to the larger datasets and hopefully this will allow me to replicate the problem in house.Mattgb
It looks like the problem was being caused by the trace file that I had left in the server code, and it was causing an i/o error 32. Schoolboy error I guess. However, I think I may still have a situation where I could potentially get a bottle neck connecting to the SQL Server, I would have preferred a seperate connection per session but that does not seem to be the case, or should I set the db Objects to ASync?Mattgb
What you mean by a separate connection per session? Usually I do a different database connection per DataSnap client, if it is what you mean, it is the natural way to go to me.jachguate
Are your users connecting to different databases on the server? If not, why would you want each user to have a different database connection? Isn't it more efficient to use the same TSQLConnection for all users and let the TSQLConnection spawn new connections as needed to service all of the database requests (e.g., spawn a new connection if the existing connection is busy running another query)?James L.

1 Answers

1
votes

It could be the same problem with multi-threading as described here http://blog.marcocantu.com/blog/datasnap_webinar_bedelphi_material.html It's describing how to patch DataSnap in Delphi XE3 but the same error I found in previous version like XE.