Aug 24th, 2011, 11:17 AM
spring transactions, hibernate, postgresql looks like record locking issue
ive been working with a few people on stackoverflow on this issue and still am coming up dead. here are the threads, my code is in them
it looks to me that the issue is some kind of locking, but i would expect an exception in that case. i can't understand why the execution would just stop indefinetly.
overview, i have spring 3.0.5, hibernate 3.6.5 and the postgres 9.0 driver. i have my code written in a DAO model (no services) to match an existing system. my tests look like this
in every case, the delete row works fine, but execution stops when hibernate sends the insert sql to the database and it just sits there. similarly, if i do
row 1 will insert correctly and row 2 will hang.
in the second forum ive posted the locks on the table in postgres, im thinking thats the issue, for some reason spring is messing up the locks. i don't know why that would be but that seems to be the problem.
anyone have a direction that i can start looking in? ive got 4 developers waiting for this to be done before they can move forward again so i really need some help here. im completely stumped and am stabbing at things in the dark here.
Aug 24th, 2011, 11:49 AM
i just ran another test, if i use the code listed in the forum against an hsql db, it works perfectly. run it against postgres and it hangs on that insert. i need some help here.
Aug 24th, 2011, 02:10 PM
Which imho indicates either a problem with the postgressql driver or postgres hibernate stuff.
Please post your hibernate.cfg.xml because I cannot see how you configured hibernate.
Next to that your deleteAllUsers method isn't really transactional (no @Transactional) although I doubt that is the problem as your test case is transactional so all happens in a single transaction.
Tags for this Thread