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

[GSS](7.1.z) HHH-12075 Hibernate SQLQuery#executeUpdate() does not invoke Statement#setQueryTimeout()

    Details

    • Target Release:
    • Steps to Reproduce:
      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) ".)
    • Sprint:
      EAP 7.1.1

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  gbadner Gail Badner
                  Reporter:
                  mmiura Masafumi Miura
                  Tester:
                  Jiří Bílek
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: