473,395 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Strange SQLCloseCursor Problem

I used the below code to fill the table using BulkOperations (abbrev.)
After finishing it, the table is filled with all values, BUT the cursor
still
hangs (as seen in the Enterprise manager) and blocks the next created
cursor, so the deadlock arises and the program freezes.

What am I doing wrong?
Thanks for your answers in advance, Michael

#define MAX_STRUCT 1

struct InsCard {
unsigned long ID_IMPORTU;
long i1;
};

InsCard* ICStruct;
ICStruct = (InsCard*)malloc(MAX_STRUCT*sizeof(InsCard));

SQLAllocStmt( hdbc, &hstmt);
SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, (void*)MAX_STRUCT, 0);
SQLSetStmtAttr(hstmt, SQL_ATTR_CONCURRENCY,(void*)SQL_CONCUR_VALUES,0);
SQLSetStmtAttr(hstmt, SQL_ATTR_CURSOR_TYPE,
(void*)SQL_CURSOR_KEYSET_DRIVEN, 0);
SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_BIND_TYPE, (void*)sizeof(InsCard), 0);

SQLBindCol(stmtSel, 1, SQL_C_ULONG, &ICStruct[0].ID_IMPORTU, 0,
&ICStruct[0].i1);
ICStruct[0].i2=0;
SQLExecDirect(stmtSel, (UCHAR*)sql, SQL_NTS);

ICStruct[0].ID_IMPORTU =1;
ICStruct[0].i1 =0;
int currentrow=1;

SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, (void*)currentrow, 0);
SQLBulkOperations(hstmt, SQL_ADD);

free(ICStruct);
SQLCloseCursor(hstmt);
SQLCancel(hstmt);
SQLFreeStmt(hstmt, SQL_DROP);
P.S.
The presence or absence of SQLCloseCursor(hstmt) and/or SQLCancel(hstmt)
is not affecting the deadlock by any way.
Jul 20 '05 #1
0 1492

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Allcomp | last post by:
Hello, I have seen something strange on a customer's computer. It is a P4 3 GHz with 512 MB Ram running on a Win2K SP3 When he uses a part of my application, it is really slow (more than 10 sec...
25
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
2
by: TB | last post by:
I am seeing a very strange problem as follows... I have a loop where a fair amount of processing is going on and near the top of the loop I access a class that has only static helper functions...
1
by: Sam Kong | last post by:
Hello! Recently I had a strange problem with Visual C# 2005 beta 1. When I ran(F5 key) a program, <#if DEBUG> statement was not working. It ran as RELEASE mode. So I had to manually define...
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
11
by: Martin Joergensen | last post by:
Hi, I've encountered a really, *really*, REALLY strange error :-) I have a for-loop and after 8 runs I get strange results...... I mean: A really strange result.... I'm calculating...
12
by: StephQ | last post by:
I have a class Bounds with two constructors: class Bounds { private: list<SegmentupperLinearSpline; // Upper bound. list<SegmentlowerLinearSpline; // Lower bound. ....
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
5
by: ioni | last post by:
Good day, fellows! I have a strange problem – at my site there is a flash strip, that loads data dynamically. It works fine (grabs data from the remote server and presents it), however in IE7...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.