1) Part and Prog are found earlier in the code, and each is a single Item (tested).
2) The code compiles ok
(see Code):
Item seq1
= inn.newItem("Sequence","get");seq1.setProperty("name","mf_Go"+ Prog.getProperty("hum_program_code","") +"1");
seq1 = seq1.apply();
if(seq1.getItemCount()<1)
{
seq1 = inn.newItem("Sequence","add");
seq1.setProperty("name","mf_Go"+ pcode +"1");
seq1.setProperty("prefix","PU");
seq1.setProperty("suffix",pcode);
seq1.setProperty("current_value","0");
seq1.setProperty("pad_with","0");
int a = 9 - pcode.Length;
seq1.setProperty("pad_to",a.ToString());
seq1.setProperty("step","1");
seq1 = seq1.apply();
}
if(seq1.getItemCount()==1)
{
//Code hangs here
string s = inn.getNextSequence(seq1.getProperty("name",""));
part.setAction("edit");
part.setProperty("hum_go_contract_number", s);
part = part.apply();
}
3) querying seq1 at the point it hangs returns the Item:
12/23/2014 8:44:51 AM :
Seq1a: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><Result><Item type="Sequence" typeId="2B46201802CE46708C269667DB4798AC" id="C75B1E5A553847EEB545F12D9FC192C4"><config_id keyed_name="mf_Go2FE1" type="Sequence">C75B1E5A553847EEB545F12D9FC192C4</config_id><created_by_id keyed_name="Martin Fraser" type="User">6F389407246440B7B40D37D4C9ACFEDE</created_by_id><created_on>2014-12-23T08:44:51</created_on><current_value>0</current_value><generation>1</generation><id keyed_name="mf_Go2FE1" type="Sequence">C75B1E5A553847EEB545F12D9FC192C4</id><initial_value>0</initial_value><is_current>1</is_current><is_released>0</is_released><keyed_name>mf_Go2FE1</keyed_name><major_rev>A</major_rev><modified_by_id keyed_name="Martin Fraser" type="User">6F389407246440B7B40D37D4C9ACFEDE</modified_by_id><modified_on>2014-12-23T08:44:51</modified_on><new_version>1</new_version><not_lockable>0</not_lockable><pad_to>6</pad_to><pad_with>0</pad_with><permission_id keyed_name="Sequence" type="Permission">59DA83671F954A3490C30CD9C9CCE42C</permission_id><prefix>PU</prefix><step>1</step><suffix>2FE</suffix><name>mf_Go2FE1</name></Item></Result></SOAP-ENV:Body></SOAP-ENV:Envelope>
Error: Calling string s = inn.getNextSequence(seq1.getProperty("name","")); causes the database to hang. It does not produce an error and it does not process the next line.
When I search the database the sequence does not exist.
Note: If I did not have permision to add the item, I would get an innovator fault. Everything appears to work correctly then roll-back to the previous state.
Please help!
Many thanks,
Martin
PS. Merry Christmas.