13 messages in com.mysql.lists.plusplusStored Procedures & Multiple Result Sets
FromSent OnAttachments
Jalon, Arnon29 Jun 2005 18:06 
Warren Young29 Jun 2005 19:15 
Jalon, Arnon30 Jun 2005 14:21 
Warren Young30 Jun 2005 15:08 
Jalon, Arnon30 Jun 2005 16:16 
Jalon, Arnon07 Jul 2005 16:30 
Jalon, Arnon07 Jul 2005 16:38.zip
Warren Young08 Jul 2005 00:30.gz
Jalon, Arnon11 Jul 2005 07:07.gz
Warren Young11 Jul 2005 07:35 
Jalon, Arnon13 Jul 2005 09:15 
Warren Young18 Jul 2005 05:43 
Jalon, Arnon18 Jul 2005 13:16 
Subject:Stored Procedures & Multiple Result Sets
From:Jalon, Arnon (Arno@247RealMedia.com)
Date:06/29/2005 06:06:57 PM
List:com.mysql.lists.plusplus

Hi, I've recently started using stored procedures with mysql 5.0.7-beta. I was using the Query and Result objects to process results for a query to a stored proc that returns a result set, and noticed a problem when trying to process multiple calls to the query on the same Connection. I tested by trying to run the query thousands of times on the same connection. I was getting a CR_SERVER_LOST error after a random number of query executions- sometimes after just one successful execution, sometimes after thousands.

It seems that the c api treats a call to a stored procedure that returns a result set as a multi query execution and, even though my stored proc was only returning one result set, the lack of proper clean up of the multiple result sets on a connection can cause this sort of error. I was able to figure this out by hacking connection.h to make the MYSQL instance variable public, and then using it to iterate through the result sets using mysql_next_result and mysql_free_result c api calls in my code after processing the result set that I wanted, which seemed to cause the error to disappear. I was wondering if there is any way to deal with multiple result sets in mysql++, or if there is any planned support for it down the road?

Thanks for any help,

--Arnon

Arnon Jalon / Software Engineer T: +1.212.231.7159 / F: +1.212.760.1774 arno@247realmedia.com

24/7 Real Media, Inc. (NASDAQ: TFSM) 132 West 31st Street, 9th floor New York, NY 10001

WWW.247REALMEDIA.COM

DELIVERING TODAY >DEFINING TOMORROW