Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-38

When making multiple stored procedure calls the parameters for one callable statement get associated with another callable statement

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0, 1.1.1, 1.1.2
    • Fix Version/s: 1.1.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7, I have tried on MariaDB 5.1-5.5.29 as well as MySQL 5.1 - 5.5

      Description

      I have a program that saves off window size and location for multiple windows when the user selects to save current preferences. Each window creates a callable statements, sets the parameter values and performs an execute. The parameters from one callable statement are being applied to another callable statement. Each callable statement is used only once. The process fails when the wrong parameter type is evaluated at execution. I have verified that the correct data is being set and the exception includes data that was sent by other calls.

        Gliffy Diagrams

          Attachments

          1. bart.log
            24 kB
          2. JavaApplication2.jar
            7 kB
          3. MainApp.java
            2 kB
          4. ProcedureExecuter.java
            3 kB
          5. Quarantined Attachment.txt
            0.3 kB
          6. runtest.tbat
            0.1 kB
          7. tester.sql
            2 kB

            Activity

            Hide
            wlad Vladislav Vaintroub added a comment - - edited

            Can you please try to make a runnable test (junit is fine, but small java program with main() is ok as well) ?

            Let's concentrate just on database and JDBC calls, and abstract from what program actually does.
            What is in the DDL (tables, stored procedures and functions), how do you call stored procedures , how you're using JDBC (the actual code), that is in the exception exactly, including error code and text, what SQL commands are send to the server(you can see them if you switch on logging on the server side), and other relevant information you can gather?
            Thanks!

            Show
            wlad Vladislav Vaintroub added a comment - - edited Can you please try to make a runnable test (junit is fine, but small java program with main() is ok as well) ? Let's concentrate just on database and JDBC calls, and abstract from what program actually does. What is in the DDL (tables, stored procedures and functions), how do you call stored procedures , how you're using JDBC (the actual code), that is in the exception exactly, including error code and text, what SQL commands are send to the server(you can see them if you switch on logging on the server side), and other relevant information you can gather? Thanks!
            Hide
            scott123 James Scott added a comment -

            If you get the zip file, you do not need the others. The two java files require the JDBC Client to execute. Bart.log is the server log of execution. Tester.sql will set up your MariaDB or MySQL database.

            This is a threading issue. It only happens when multiple threads are getting unique CallableStatements from a single Connection.

            The log shows very clearly (open with notepad++ or word pad) that the variables are being reused by multiple statements prior to execution of the first statement.

            Please confirm that you received this email. The mail server may block part or all of it.

            Thanks,
            James

            Show
            scott123 James Scott added a comment - If you get the zip file, you do not need the others. The two java files require the JDBC Client to execute. Bart.log is the server log of execution. Tester.sql will set up your MariaDB or MySQL database. This is a threading issue. It only happens when multiple threads are getting unique CallableStatements from a single Connection. The log shows very clearly (open with notepad++ or word pad) that the variables are being reused by multiple statements prior to execution of the first statement. Please confirm that you received this email. The mail server may block part or all of it. Thanks, James
            Hide
            wlad Vladislav Vaintroub added a comment -

            Yes, all of your source files and jar are attached to the bug just fine

            Show
            wlad Vladislav Vaintroub added a comment - Yes, all of your source files and jar are attached to the bug just fine
            Hide
            wlad Vladislav Vaintroub added a comment -

            This was indeed a threading issue (hard to guess from the original description ) .Thanks for reporting, I fixed it for the next version.

            Show
            wlad Vladislav Vaintroub added a comment - This was indeed a threading issue (hard to guess from the original description ) .Thanks for reporting, I fixed it for the next version.

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                scott123 James Scott
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 7 hours
                  7h