MariaDB Client Library for Java Applications
  1. MariaDB Client Library for Java Applications
  2. CONJ-38

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

    Details

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

      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.

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

        Activity

        Hide
        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
        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
        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
        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
        Vladislav Vaintroub added a comment -

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

        Show
        Vladislav Vaintroub added a comment - Yes, all of your source files and jar are attached to the bug just fine
        Hide
        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
        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:
            Vladislav Vaintroub
            Reporter:
            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