List:MySQL++« Previous MessageNext Message »
From:Arnon Jalon Date:June 30 2005 1:07am
Subject:Stored Procedures & Multiple Result Sets
View as plain text  
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 
arnon.jalon@stripped	
	
24/7 Real Media, Inc. (NASDAQ: TFSM) 
132 West 31st Street, 9th floor
New York, NY 10001	
 	
WWW.247REALMEDIA.COM
>DELIVERING TODAY >DEFINING TOMORROW

Thread
Stored Procedures & Multiple Result SetsArnon Jalon30 Jun
  • Re: Stored Procedures & Multiple Result SetsWarren Young30 Jun
RE: Stored Procedures & Multiple Result SetsArnon Jalon30 Jun
  • Re: Stored Procedures & Multiple Result SetsWarren Young1 Jul
RE: Stored Procedures & Multiple Result SetsArnon Jalon1 Jul
RE: Stored Procedures & Multiple Result SetsArnon Jalon8 Jul
  • Re: Stored Procedures & Multiple Result SetsWarren Young8 Jul
RE: Stored Procedures & Multiple Result SetsArnon Jalon8 Jul
RE: Stored Procedures & Multiple Result SetsArnon Jalon11 Jul
  • Re: Stored Procedures & Multiple Result SetsWarren Young11 Jul
RE: Stored Procedures & Multiple Result SetsArnon Jalon13 Jul
  • Re: Stored Procedures & Multiple Result SetsWarren Young18 Jul
RE: Stored Procedures & Multiple Result SetsArnon Jalon18 Jul