Previous Post
__________________________________________________ ___________
"I have written a multi-thread C++ ESQL application using dynamic SQL method 4(Descriptor) for handling select statements/method 1 for insert/delete/update/stored procedure. The model is one thread one connection, each with a unique connection name.
For handling insert/delete/update, no problem.
For handling select, it worked before. After i have changed a bit the source code(should not be related to SQL), after i have corruped a databaes device and fixed it and the then my program doesn't work properly now. When the server handles the select statement in the first time, it works, but not after. In other words, the connection only works for the first time for select!
My Code:
EXEC SQL allocate DESCRIPTOR DES with max QLCount ;
SQL Error:
Sqlcode: -33620275
Sqlerrmc: cs_objects: cslib user api layer: external error: ZZZZZ cs_objects: error performing requested operation.

I found the answer below from the internet and I have used purify to check my application and there was no error!

“For that particular error, since it's related to cs_objects, we may consider the possibility of an array overflow or a bad pointer in the application, which might have corrupted an Open Client object structure. As Anthony said, a debugger should help.”

I really have no idea, could anyone please give me some advice on this issue?????"
************************************************** ***
New Post:
__________________________________________________ ___________
I finally found that this error occurs when my program doesn't deallocate the descriptor and allocate it again.(My program supports many select requests).
However, if i deallocate the descriptor and allocate it again, i got a warning in visual C++ output window:
"HEAP[SybaseFinal.exe]: HEAP: Free Heap block 916270 modified at 91638c after it was freed"
It crashed in Releaes Mode!
The same problem occurs when i deallocate prepare statement. Can anyone give me some advice on this issue????