Hi everybody,
i'm currently writing on some server application accessed by many clients at the same time.
So i'm searching for the best way to realize thread safe DB access,
after reading and searching here for a while 3 ways are possible in my opinion.
1. One DB Connection for each client
This should work for each supported DB right ?
Where should the uniconnection should be created ?
In the main thread, in the "client-Thread" or both ways are working ?
2. Using one DB-Connection for all clients, but use a transaction
for each client.
But how is it if the DB doesn't support transactions (MySQL MyISAM, oder SQLite) ?
3. Creating a "Connection-Pool", which is granting thread safe access to a pool of db connections
Please let me know if there other solutions or any mistakes in my thoughts.
Which way is the best in general ?
Which way is the best for a high frequented web server ?
Please push me into the right direction,
many thanks in advance,
DataCool