Announcement Announcement Module
Collapse
No announcement yet.
connection release mode Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment


      • #4
        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!

        Comment


        • #5
          What's the behavior on Hibernate 3.0.5?

          Comment


          • #6
            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

            Comment


            • #7
              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..).

              Comment


              • #8
                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. >:-(

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      I now tested with Hibernate 3.1 final. No hibernate.connection.release_mode parameter is required here any more. Everything is working fine.

                      Comment


                      • #12
                        Great work ojs! If there is any issue on JIRA please link this thread as a comment. I'm pretty sure it will save a lot of time for some people.

                        Comment

                        Working...
                        X