Currently I have my java application running in multiple servers. I have a data transaction which is encountering a deadlock. I tried using thread and synchronization, but in vain, as there are multiple application instances in multiple servers. Each application instance have their data transaction synchronized, but different synchronized application transactions on the same database happens to land the database in a deadlock situation, as for all application instances the database is same and one.
Kindly suggest the right approach in this kind of situation. Any high level solution will also suffice.