XalanJ2
  1. XalanJ2
  2. XALANJ-1908

SQL Extension exec stored proc breaks between 2.5.1 and 2.5.2/2.6.0

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.6
    • Fix Version/s: None
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      > SQLDocument.java line 407 execute returns false for this query:
      >
      > declare @InstKy int
      > declare @MConKy int
      > declare @Result int
      > select @InstKy= -1
      > select @MConKy= 1886524808
      > exec @Result= ICntrTyOpn 1886524808
      > , @InstKy output
      > , @MConKy output
      > , 1021
      > , 2
      > select @InstKy, @MConKy, @Result

      That is kind of what I was expecting. The API Docs say that Execute returns
      false if the execute is an Update or if the Query returns does not return a
      result set. Not returning a results set is different than a query that returns
      an empty result set. Can you explain what this SP is trying to do ?

      I took a look at the 2.5.1 code and I see a subtile difference in how the
      Query is executed. In 2.5.1 we were using executeQuery and not execute.

      Can you try the following mod:
      Orig Code:
      m_Statement = conn.createStatement();
      if (! m_Statement.execute(m_QueryParser.getSQLQuery()))

      { throw new SQLException("Error in Query"); }

      New Code:
      m_Statement = conn.createStatement();
      m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()))
      return;

      Yes the change (executeQuery) works for all the situations I tested.
      Nearly all our stored procedures move data between a set of normalized tables of
      permanent data and another set of denormalized tables with temporary data. A
      whole bunch of overhead SQL is called as well, but no result sets are returned.
      Separate queries select the temporary data.

      Is the difference between execute and executeQuery going to break someone else's
      use?

        Activity

        Hide
        Henry Zongaro added a comment -

        Bug priority was lost in the move from Bugzilla to Jira.

        Show
        Henry Zongaro added a comment - Bug priority was lost in the move from Bugzilla to Jira.

          People

          • Assignee:
            Unassigned
            Reporter:
            Phil Friedman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development