RC command - Error Code 46 problem

It would be highly appreciated if anyone can guide me on the following issue:

Introduction:
We use VC++ programming (C programming) to connect to ADABAS database to pull records of data.

Problem:
Encounter Error Code 46.

Some info obtained:
RESPONSE 46
Explanation:
Mismatch of format buffer usage for the supplied command ID.
• A command ID of global ID format buffer has been found in the format pool and has a different file number to the file supplied by the caller;
• The file number was changed in subsequent Adabas calls with the same normal or global command ID.

Action Check the usage of the command IDs.

Solution that we are working on :

We are trying to release command-id by an explicit RC command.
How do we do this? Please advice.

Question to perform RC command to release command-id:

Some info obtained:
All command IDs currently assigned to the user are to be released.
Control Block

Command Code RC
Command ID X’00000000’ binary zeros indicate that all command IDs are to be released
Command Option 1/2 bb all CID types to be released

a) Only command code, command id and command option 1/2 are specified. What value should we set for the rest?
b) Does the same method call such as below will be used to perform RC command?

adabas ( &control_block , &format_buffer , &record_buffer , &search_buffer , &value_buffer , &isn_buffer )

c) Can you provide sample of command line used to perform RC command to release command-id?
d) By releasing command-id, will this solve our problem?

Current Trial
Currently, what I tried:

Use this command:
adabas ( &control_block , &format_buffer , &record_buffer , &search_buffer , &value_buffer , &isn_buffer )

In command block, I set
Command Code = RC
Command id = 0000
Command option 2 = 0

Set length = 0 for all the other buffers.

Result of trial

The method executed without error. However, it does not seem to actually release the command id from the pool. Because, I still experience problem with Response code 46.

Question:

  • How do we ensure that the code was run successfully i.e command id has been released from the pool?
  • Is there any other solution for Response code 46? Any other suggestion?

what call are you getting a Response 46 on? what are you setting for the command options, command id on the call that is getting the error? Is the error on the first call with that command id or subsequent one?

We experience Error Code 46 when we made extensive calls from C programming to ADABAS. Not the first call. See… we have website in which user make a search. For every search, a call will be made to ADABAS from C programming to retrieve data for the search. So, you can imagine number of user who access the website.

We get error code 46 after approximately for 100th and above call. Somemore, it is intermittent. It throws error 46 then turn normal… then error and so on.

Please refer to the attachment that I provided:

  1. description.txt
  • describe problem analysis
  1. get_title_info.txt
  • the method which caused error code 46
    (will attach in a separate post reply)
  1. Copy of n 11Aug2006 1020pm.txt
  • the log file which log response code and command id
    (will attach in a separate post reply)

Very sorry for sounding very technical. I really need help on this since we need to solve the issue urgently. Reply from you is highly appreciated.
Thank you.
description.txt (5.2 KB)

PFA:

  1. get_title_info.txt
  • the method which caused error code 46

And error code 46 comes for the following method call:

find_record(cmd_id,
			FMTBUF,
			FBLEN,
			RECBUF,
			SEABUF,
			SBLEN,
			VALBUF,
			VBLEN,
			file_number,
			&find_status,
			&rec_num,
			&first_call);

if (find_status != ADA_NORMAL)
{
	*title_return_code = 9999;
	memset (o_error_message,0,MSG_LENGTH);
	strcpy (o_error_message,E00001);		
	strcat (o_error_message,"one");		

	free(FMTBUF);
	free(SEABUF);
	free(VALBUF);	
	return;
}

get_title_info.txt (9.57 KB)

PFA:

  1. Copy of n 11Aug2006 1020pm.txt

Could it be that you are using the same command id in one of the following situations:

  1. return status is not normal - it appears that the command id is not released in that case
  2. queries for different files are using the same command id (fnr_lbs_land_lot, fnr_lbs_strata_lot)

I have set different command id for different file number. So far, the error code 46 is not coming.
Thanks, Douglas.