Results 1 to 3 of 3

Thread: spring transactions, hibernate, postgresql looks like record locking issue

  1. #1
    Join Date
    Jul 2006
    Posts
    14

    Default 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

    http://stackoverflow.com/questions/7...in-transaction

    http://stackoverflow.com/questions/7...ction-take-two

    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

    dao.deleteallrows()
    dao.inserttow()

    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

    dao.insertrow1()
    dao.insertrow2()

    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.

    thanks guys

  2. #2
    Join Date
    Jul 2006
    Posts
    14

    Default

    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.

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •