Here are some tidbits I promised in terms of source code and slides for recent sessions.
BE-Delphi Material
- Slides (in PDF) of my Windows 8 session at BE-Delphi
- Slides (in PDF) of my Getting ready for Mobile session at BE-Delphi
- Source code for two simple demos I showed in the mobile session above
DataSnap Webinar Material
- Source code for the datasnap webinar demos (3 simple projects, plus the speed testing code -- more information below on this last one)
- The webinar white paper (almost 40 pages) is available for downalod in the webianr landing page at http://www.embarcadero.com/home/development-and-deployment-of-delphi-multi-tier-applications
- The webinar recording (including the Q&A sessions) will be available real soon.
- I'm also trying to compile a Q&A list, and will blog this.
Patching the DataSnap Server for Multi-threading
If you download the source code for my datasnap webinar, you'll see that there is a simple speed test demo. Using it, you can change some of the settings of the server, and also enable sessions management in the client application. I cover this in detail in the white paper (where the code is listed and explained), and also blogged about this at http://blog.marcocantu.com/blog/datasnap_deployment_performance.html. The client of that speed testing demo has the option to run multiple threads hitting the server at the same time. As discussed in that blog post (and in others!) this easily crashes the server.
As I already mentioned the R&D team jumped on this and has provided a number of fixes that will ship in Delphi XE3 Update 1, available soon. For the time being, however, you can apply the most relevant patch (again, not the only one) manually. Get the source code of the Data.DBXCommon.pas from the Delphi source, copy it in your project source code folder, add the unit to your project, open it in the editor, search the implementation of the method TDBXConnectionFactory.GetDriver, leave the initial part as it is and replace the line with the call to TDBXDelegateDriver.Create (listed also below) with the following "safer" code:
TDBXDriverRegistry.DBXDriverRegistry.FDrivers.LockList;
try
Result := TDBXDelegateDriver.Create(TDBXDriverRegistry.DBXDriverRegistry.GetDriver(DriverDef));
finally
TDBXDriverRegistry.DBXDriverRegistry.FDrivers.UnLockList;
end;
This is not the only fix but the most relevant one, so I felt it was worth sharing it right away. Others will be included in the coming update for Delphi XE3 (and C++Builder, alike). Going forward, we are adding some serious multithreaded testing to the internal test suites, to avoid similar issues in the future. Reworking and improving DataSnap is on my table, and I'm open to suggestions.
More to Come
Again, replay video is coming... and also a Q&A blog post is in the works... along with a "DataSnap white paper compilation" from material I wrote over the last 2 or 3 years on the topic. Stay tuned to my blog.