1) Can a single connection to a MySql database be shared among applications?
2) Are there any possibilities that an error might accure when two applications
compete for a single connection to a MySQL database? For example, Application
1 is using the connection to submit an insert operation to the MySQL database.
So before Application 1 can complete the insert operation, Application 2 starts
to submit an insert operation to the MySQL database. Therefore a deadlock takes
place. If so what would you recommend?
1. Do you mean one reference? If so, there is no point in this. You can simple without any harm and time consumption create a new connection reference (connection conn = new connection("string");.
No. The command will take those data that are currently available on the server. So if command1 just occured before command2, command2 will take the new data, if not, there will be only old data available for the command2.