[CONJ-38] When making multiple stored procedure calls the parameters for one callable statement get associated with another callable statement Created: 2013-05-20  Updated: 2013-05-22  Resolved: 2013-05-22

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.0, 1.1.1, 1.1.2
Fix Version/s: 1.1.3

Type: Bug Priority: Major
Reporter: James Scott Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 7, I have tried on MariaDB 5.1-5.5.29 as well as MySQL 5.1 - 5.5


Attachments: File JavaApplication2.jar     Text File MainApp.java     Text File ProcedureExecuter.java     Text File Quarantined Attachment.txt     Text File bart.log     File runtest.tbat     File tester.sql    

 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.



 Comments   
Comment by Vladislav Vaintroub [ 2013-05-20 ]

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!

Comment by James Scott [ 2013-05-21 ]

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

Comment by Vladislav Vaintroub [ 2013-05-22 ]

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

Comment by Vladislav Vaintroub [ 2013-05-22 ]

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

Generated at Thu Feb 08 03:12:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.