1,105,633 Community Members

Connection

Member Avatar
solomon_13000
Junior Poster
119 posts since Jul 2009
Reputation Points: 14 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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?

Member Avatar
Mitja Bonca
Posting Maven
2,561 posts since May 2009
Reputation Points: 557 [?]
Q&As Helped to Solve: 489 [?]
Skill Endorsements: 21 [?]
 
0
 

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.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: