I'm having some deadlocks in my Postgres DB. I posted a question there and the only response I got indicated it was probably a hibernate-postgres issue.
Please take a look at:
and let me know if this really is likely to be a hibernate issue.
I can't debug the problems occuring on the server, but on my DB machine the one time it has occurred the problem is as follows:
- I'm using Hibernate 3 with PostgresSQL 8.
- I ran an app that launches up to 20 simultaneous threads to import some data into the DB. Intuitively this seems a likely source of the original deadlock, but this app has never been run on the public server, so if it's a source of problems then it's not the cause of the deadlocks on the public server.
- I later noticed that going to a particular page never returns. This is the same symptom I see on the public server.
- When I trace it on my local machine I find that it reaches a point in the code where it does a DB update and then it just stops.
- When I check Postgres I see that each new hit to that page causes a new process to wait on a particular lock. If you look in the info in the other page I linked to above, you'll see that for some reason all new inserts are part of the same transaction.
- Note that going to that page should not actually cause any updates. It looks to me like it's trying to finish an update that hibernate has queued up. That idea would fit with the idea that all the updates are part of the same transaction.
I apologize if that description is hazy. I really have little idea about what is going on. I don't want to restart the app server on my dev machine until I figure this out, so I'd appreciate any help anyone can give.
If anyone can determine from this info and the info on the other page if this is actually a postgres issue or a hibernate issue or both then I would be very grateful.