IDataHashCursor migration bug

Hi Wmusers! Just wanted to ask about a problem I hit when upgrading an IS server from 4.6 to Fabric 7.

Some really old Java services use the old IDataHashCursor cursor class (which is deprecated but provided for backward compatibility.)

The problem in that, on Fabric 7, the IDataHashCursor.first(object_key) method seems to wrongly move the cursor to the first available IData object in the pipeline if ‘object_key’ IData object is not in the pipeline. However, on 4.6, the cursor isn’t repositioned.

The following code illustrates this – it picks 2 string values from the pipeline and outputs them back out:

		IDataHashCursor pipelineCursor = pipeline.getHashCursor();
		pipelineCursor.first( "A" );
		String	A = (String) pipelineCursor.getValue();
		
		pipelineCursor.first( "B" );
		String	B= (String) pipelineCursor.getValue();
		pipelineCursor.destroy();
		
		// pipeline
		IDataHashCursor pipelineCursor_1 = pipeline.getHashCursor();
		pipelineCursor_1.last();
		pipelineCursor_1.insertAfter( "extracted_A", A);
		pipelineCursor_1.destroy();
		pipelineCursor_1.insertAfter( "extracted_B", B);
		pipelineCursor_1.destroy();

When the service is run in Developer with these inputs:


A = 1
B = (nothing)
(Do not click on "Include empty values for string types" ) 

…The output in Developer 4.6 is as expected:


extracted_A = 1
extracted_B = null

…However, the output in Developer 6.5/Fabric 7 is:


extracted_A = 1
extracted_B = 1

Similar behavior occurs if the ‘B’ input was set and the ‘A’ value was absent.

Has anyone dealt with this before?

Sonam,

Just to be clear, are you working with IS 6.5 or a pre-release version of IS 7.1?

Seems like I’ve seen similar threads to yours related to migration in the last six months or so.

Mark

Thanks Mark.

I’m working with IS 6.5 SP2 installed by the Fabric 7 installer.

Does this remind you of something you’ve seen? I did search the forums for “IDataHashCursor first” before posting but didn’t get anything.

Just a followup - wM commented this change in behavior between 4.6 and 6.5 is “expected” and won’t fix it. I am working around this issue by rewriting the affected Java service input/outputs to use IDataCursor. Using the ‘Tools > Generate Code’ menu option in Developer helps in this process. In case anyone is wondering, IDataHashCursor was deprecated in IS 4, and the affected services are mostly of IS 3.6 vintage.