Re: Prepared Statements not getting closed
Andrii,
Thank you for the response.
I added the close and delete calls to the catch clause but it does not solve the problem.
I don't think that part gets executed because an exception is never thrown at least not until I exceed the number of prepared statements and at that point the program aborts.
now the code looks like this:
try {
cout << "executing prepared stmt\n";
res = pstmt->executeQuery();
cout << " closing prepared stmt\n;"
pstmt->close();
delete pstmt;
}
catch (SQLException &e) {
cout << "ERROR: SQLException in " << __FILE__;
cout << " (" << __func__<< ") on line " << __LINE__ << endl;
cout << "ERROR: " << e.what();
cout << " (MySQL error code: " << e.getErrorCode();
if (pstmt != NULL)
{
pstmt->close();
delete pstmt;
}
}
-James
Subject
Views
Written By
Posted
12535
August 02, 2012 02:19PM
3597
August 03, 2012 01:29AM
Re: Prepared Statements not getting closed
3374
August 03, 2012 06:29AM
2840
August 03, 2012 08:17AM
3863
August 03, 2012 01:00PM
2770
August 08, 2012 10:58AM
2718
August 08, 2012 12:29PM
2762
August 08, 2012 02:33PM
2541
August 09, 2012 07:31AM
2633
August 09, 2012 08:31AM
2461
August 10, 2012 01:49PM
2689
August 30, 2012 10:41AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.