Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-13684

[GSS](7.0.z) Hibernate SQLQuery#executeUpdate() does not invoke Statement#setQueryTimeout()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 7.0.8.GA
    • Hibernate
    • None
    • Hide

      1. Enable jdbc spy log:

      /subsystem=logging/logger=jboss.jdbc.spy:add(level=TRACE)
      

      2. Build and deploy the attached reproducer, which is based on EAP 7 quickstarts hibernate5.

      mvn clean package wildfly:deploy
      

      3. Access the web-app
      3-1) test.SelectServlet, which specifies SQLQuery.setTimeout(5) then execute SQLQuery.list():

      curl http://localhost:8080/jboss-hibernate5/SelectServlet
      

      3-2) test.UpdateServlet, which specifies SQLQuery.setTimeout(5) then execute SQLQuery.executeUpdate():

      curl http://localhost:8080/jboss-hibernate5/UpdateServlet
      

      3-3) test.UpdateServlet2, which specifies Query.setTimeout(5) then execute Query.executeUpdate():

      curl http://localhost:8080/jboss-hibernate5/UpdateServlet2
      

      Check server.log and you can cofirm that Statement#setQueryTimeout() is invoked in SelectServlet / UpdateServlet2 but it's NOT invoked when executing in UpdateServlet from the jdbc spy logging. (You can confirm this by the jdbc spy log message "[Statement] setQueryTimeout(xxx)".)

      Show
      1. Enable jdbc spy log: /subsystem=logging/logger=jboss.jdbc.spy:add(level=TRACE) 2. Build and deploy the attached reproducer, which is based on EAP 7 quickstarts hibernate5. mvn clean package wildfly:deploy 3. Access the web-app 3-1) test.SelectServlet, which specifies SQLQuery.setTimeout(5) then execute SQLQuery.list(): curl http: //localhost:8080/jboss-hibernate5/SelectServlet 3-2) test.UpdateServlet, which specifies SQLQuery.setTimeout(5) then execute SQLQuery.executeUpdate(): curl http: //localhost:8080/jboss-hibernate5/UpdateServlet 3-3) test.UpdateServlet2, which specifies Query.setTimeout(5) then execute Query.executeUpdate(): curl http: //localhost:8080/jboss-hibernate5/UpdateServlet2 Check server.log and you can cofirm that Statement#setQueryTimeout() is invoked in SelectServlet / UpdateServlet2 but it's NOT invoked when executing in UpdateServlet from the jdbc spy logging. (You can confirm this by the jdbc spy log message " [Statement] setQueryTimeout(xxx) ".)

    Description

      Hibernate org.hibernate.SQLQuery#executeUpdate() does not invoke java.sql.Statement#setQueryTimeout() even if SQLQuery#setTimeout() is specified.

      Note that org.hibernate.SQLQuery#list() and org.hibernate.Query#executeUpdate() works fine but org.hibernate.SQLQuery#executeUpdate() does not work.

      Attachments

        Issue Links

          Activity

            People

              gbadner@redhat.com Gail Badner (Inactive)
              rhn-support-mmiura Masafumi Miura
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: