I am using Delphi XE2 along with DISQLite v3 (which is basically a SQLite3 port). I like everything about SQLite3, except for the lack of concurrent writing , especially since I actively rely on multithreading in this project :(
My profiler made it clear that I needed to do something, so I decided to use this approach:
Whenever I need to insert a record in the database, instead of doing an INSERT, I write SQL query in a special file, i.e.
WriteToFile_Inline(SPECIAL_FOLDER_PATH + '\' + GUID, FileName + '|' + IntToStr(ID) + '|' + Hash + '|' + FloatToStr(ModifDate) + '|' + ...);
I added a timer (in the main thread of the application) that fires every minute , parses these files, and then INSERT QUESTIONS using a transaction.
Delete these temporary files at the end.
Result . I like the 500% performance boost . Plus, this ACID method, since I can always check SPECIAL_FOLDER_PATH after a power failure and execute the found INSERTs.
Despite the good results, I am not very happy with the method used (hacks, to say the least), I continue to think that if I had a generics-like with quick search access, thread-safe, ACID list, that would be much cleaner (and maybe faster?)
So my question is: do you know anything like this for Delphi XE2?
PS. I hope that many of you, having read the above code, will be shocked and begin to insult me at this moment! Please be my guest, but if you know a better (i.e. faster) ACID approach, share your thoughts !
source share