There are 2 different applications running on the same jboss server. I want to connect these 2 applications with the same mysql database through the same data source.
what kind of impact can be occur in running these 2 application -
I am supposing that these issues could be happen . - Table Locking issues, Slow performance, connectivity issue, ACID properties lost issue.
Are there any drawbacks with this approach?
There are no drawbacks, as long as there are enough connections for both apps and your transactions are well written its normal to share the same datasource
Perhaps you should consider if there are any advantages?
In my opinion there is have to be compelling reasons to not create separate datasources for separate applications - I sense that this is not the case for you.
In any case, some of the drawbacks you mention may happen when you share a connection pool between applications or when you don't since they are properties of the database not the connections.
Edit: Summarizing the good discussion with Jan Dvorak below, here are some arguments for using one (or more) datasources per application:
Cheers,
Nothing of this can happen (Table Locking issues, Slow performance, connectivity issue, ACID properties lost issue).
The database cannot really distinguish if two connections come from the same application.
Of course, two applications still means twice as many requests, so performance may be affected. ACIDity is not affected and you are unlikely to run out of TCP ports either.
The performance of two apps accessing the same database is the same as the performance of one app twice as popular.
The main issue would be with pooling. As more applications use the datasource, more connections are open so the default pool may not be enough.
Apart from that, all the other issues are related to the DB engine and your DB design than to the datasource. A DB engine won't stop being ACID compliant no matter how it is accessed, won't be slower than if the accesses were from different datasources, and so on...