We are in the process of creating a web application using mysql as a data source. We are using spring with hibernate as an ORM framework. We have hundreds of entities with relations (manyToMany \ manyToOne etc..).
In the dev envioronment we currently use the hbm2dll in order to create the schemas from time to time. (after huge changes).
last week we encountered a deadlock happening (note that we do not use any explicit locking on our project). on a simple usage of the application.
removing the foreign keys from the table actually solved the issue.
So a couple of questions:
1) are foreign keys "evil"? if removing them from the DB did not affect the application logic and solved the issue - whats the point?
2) should we get rid of all of them?