- Are there any issues on opening and operating on the same SQLite database file from multiple EAs, Service etc
- When opening a database connection on the same file from multiple EAs, will they get the same handle or different handle?
- How often does it flushes data to disk? Can some data be lost? Can the file get corrupted if MT5 crashes?
- Discussion of article "SQLite: Native handling of SQL databases in MQL5"
- printf() / PrintFormat() to specified file, or Write to specified file with printf/PrintFormat() format strings...?
- Errors, bugs, questions

- 2021.04.28
- www.mql5.com
- Are there any issues on opening and operating on the same SQLite database file from multiple EAs, Service etc
- When opening a database connection on the same file from multiple EAs, will they get the same handle or different handle?
- How often does it flushes data to disk? Can some data be lost? Can the file get corrupted if MT5 crashes?
I know that this is a late response, but I've only just been considering this myself. I did a quick test for multiple EAs accessing the same SQLite DB (and same table) concurrently. I had 15 instances of an EA reading data from the same table at the same time, and outputting data uisng Print(). It worked without any issues at all. However note that I was NOT updating the DB - just reading from an already populated table.
I had 8 EA instances running in one MT5 instance and 7 in a separate MT5 instance. It seemed to be very performant given that there were 4500 records in the table. Note that I opened the database as follows using DATABASE_OPEN_READONLY.
int hDatabase = DatabaseOpen("DB Name", DATABASE_OPEN_READONLY|DATABASE_OPEN_COMMON);
If you are going to be updating the DB from multiple EA instances you may well run into problems? You'd have to test it yourself. For me, I only need to read from it and so that's all I tested.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use