Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: connection release mode

  1. #1
    Join Date
    Sep 2005
    Posts
    4

    Default connection release mode

    Hello,

    I was amazed you changed default value of hibernate property
    "hibernate.connection.release_mode" from "auto"(in 1.25) to "on_close"(in 1.26).

    Why? Is there any necessity or advantage for Spring?
    Hibernate reference says that "This setting is left for backwards compatibility,
    but its use is highly discouraged."

    Regards

  2. #2
    Join Date
    Jul 2005
    Location
    Rüdesheim, Germany
    Posts
    29

    Default

    Actually, this modification has broken my integration tests

    Execution stops in HibernateTransactionManager on line 649 (trying to get the connection from the session)

    Setting "hibernate.connection.release_mode" explicitly back to "auto" in my app ctx makes them run again...

    What's the idea behind this?

    Sebastian

  3. #3
    Join Date
    Jul 2005
    Location
    Munich, Germany
    Posts
    153

    Default

    Quote Originally Posted by flow206
    I was amazed you changed default value of hibernate property
    "hibernate.connection.release_mode" from "auto"(in 1.25) to "on_close"(in 1.26).
    In conjunction with hibernate 3.1 (rc2) this seem to broke my whole application. Spring/Hibernate/Whatever opened more and more database connections until the pool (container managed) exhausted. Setting the release_mode to 'auto' fixed the problem - connections getting closed after usage.

    A Spring 1.2.6 / Hibernate 3.1 application without release_mode manually set to 'auto' seems to be almost unusable.

    Does someone has an idea? Rod? Juergen? ;-))


    Best
    Oliver

  4. #4
    Join Date
    Nov 2005
    Posts
    1

    Default busted for me too

    I agree with you guys. This is such a big thing, I can't believe it was changed in a dot-dot release of spring. I had to add this line to my sessionFactory/hibernateProperties in my beans.xml file to get things working again:
    <prop key="hibernate.connection.release_mode">auto</prop>
    I almost woefully went back to 1.2.5 until I found this post. Yay!

  5. #5
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    What's the behavior on Hibernate 3.0.5?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  6. #6
    Join Date
    Jul 2005
    Location
    Munich, Germany
    Posts
    153

    Default

    Quote Originally Posted by costin
    What's the behavior on Hibernate 3.0.5?
    I did some tests to show where in which environmen the problem arises:



    Code:
    Spring | Hibernate | Status
    -------+-----------+------------------------
    1.2.6  | 3.1rc2    | database pool exhauses (without release_mode set to 'auto')
    -------+-----------+------------------------
    1.2.5  | 3.1rc2    | works good
    -------+-----------+------------------------
    1.2.6  | 3.1beta2  | works good
    -------+-----------+------------------------
    1.2.5  | 3.1beta2  | works good
    -------+-----------+------------------------
    1.2.6  | 3.0.5     | works good
    -------+-----------+------------------------
    1.2.5  | 3.0.5     | works good
    Best
    Oliver

  7. #7
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Great job, ojs! It appears to be a Hibernate bug and should be reported to the HB team (I wonder if it isn't already..).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  8. #8
    Join Date
    Jul 2005
    Location
    Munich, Germany
    Posts
    153

    Default

    Quote Originally Posted by costin
    Great job, ojs! It appears to be a Hibernate bug and should be reported to the HB team (I wonder if it isn't already..).
    Maybe it is an Hibernate bug, but the initial question from flow206 is still open - why has Spring changed the setting of hibernate.connection.release_mode from "auto" to "on_close" although it is discouraged by the hibernate developers.

    More surprisingly I found this Ticket in Hibernate's JIRA:

    http://opensource2.atlassian.com/pro...rowse/HHH-1038

    It says, that hibernate changed the default release_mode from ON_CLOSE to AUTO in 3.1rc2. Mhh?!

    I'm really confused about this. I'm not 100% sure if it is an hibernate bug, but I wouldn't submit it to Hibernate's JIRA anyway. Gavin King is sick of those stupid people as me that are saying that Hibernate has a bug or isn't perfect. >:-(

  9. #9
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Maybe it is an Hibernate bug, but the initial question from flow206 is still open - why has Spring changed the setting of hibernate.connection.release_mode from "auto" to "on_close" although it is discouraged by the hibernate developers.
    This question I think it's best answered by Jurgen (he's the person in charge with HB support). You can take this on the dev mailing list.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  10. #10
    Join Date
    Jul 2005
    Location
    Munich, Germany
    Posts
    153

    Default

    Hibernate 3.1rc3 came out yesterday - soon there are maven packages out, I'll drop a line how Spring 1.2.6 works with that release.

Posting Permissions

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