Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

SQL Server 2008 R2 latest updates. SQL server ODBC driver version 6.01.7601.17514 PS!!! native drivers are incompatible with the software so i cannot use them. I cannot edit or change the server software - i do not have access to sourcecode.

select MemberCount from tbl_guild where serial = 6
1255 08/23/12 07:42:20 : SqlState:HY000, NativeError:0  
Msg:[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt

UPDATE ----------------------------------------------- I ran a complete trace of SQL actions when a member was accepted in game. Results: Everything seemed to work perfectly. Selects the membercount, following with user guild data update (executes the stored procedure and completes it, updating user guild serial, status etc in table general). Everything completes successfully.

It also matches the working database actions. The fact that after server reboot people are in the guild proves that it's all ok (the server updates member count in database when server is rebooted).

The problem is with membercount. It's selected into memory (zoneserver) so in game players get accepted and database membercount value updates later (server reboot or some fixed time). Pretty bad solution but nothing i can do about that.

Somehow the membercount value never reaches the zone and wont be updated in memory, So the server writes the hstmt/busy error into the log files.

I have to add that, ODBC connections and the software itself is not corrupted. I have already remade and replaced both. Also, i have used a clean backup of database (all same but without user data in it) - renaming the problematic one so all ODBC connections etc were untouched. The guilds worked and members could be accepted.

What could possibly cause the SELECT data to get lost/time out before it reaches the server software. Is there any simple software i could use to execute the same query (select MemberCount from tbl_guild where serial = 6) over ODBC to confirm if i get the value from it?

share|improve this question

closed as off-topic by Max Vernon, Paul White, bluefeet, RolandoMySQLDBA, Kin Sep 27 '13 at 16:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Max Vernon, bluefeet, RolandoMySQLDBA, Kin
If this question can be reworded to fit the rules in the help center, please edit the question.

Is the cursor producing any kind of error message? – Aaron Aug 23 '12 at 15:19
OH forgot that. MSSQL 2008 R2 is in use. The cursor errors are always followed by a hsmt busy errors. im not doing the queries manually, they are made by the server software. and the log simply writes the query+ the error message (no specifics about what kind of problem there was with cursor). – Agony Aug 23 '12 at 16:49
I can't comment so I'll post my feedback as an answer. Does the SQL Server ERRORLOG have any additional detail when this problem occurs? Can you post the query the server uses to increment the member count? If you don't have the exact query, I'd try to do a server-side trace and get the cursor code directly and see if there's something amiss. – Michael Aug 30 '12 at 17:39
This is almost certainly a problem with the code not fully consuming and releasing a dataset before trying to process another one. It has probably started now because one of your tables has recently gotten large enough that the number of returned rows for some query no longer fits into the default number of rows returned (which may be 20, but is settable in the code). – RBarryYoung Aug 30 '12 at 19:52
I dont have access to the software sourcecode so i cant post the query it uses, except what it shows in the log above. It works with clan database and compared to it, when problem started, there wasn't that many new entries added. the hsmt error above occurs only when it selects from that table, manually selecting from it works fine. And there isnt that many rows in there - when it started, there was like 2-3 rows. I wish i could trace/log what "result" it was that kept it busy. The table has no dependencies listed nether that could mess with it. – Agony Aug 31 '12 at 18:31