I have tried with the API from the Tamino 4.2, but the same problem occurs…
Here is the code that produce the timeout error, please read the comment in the code, I have put some informations or question for you :
This code will be use to create a temporary backup of all data frome database1 to database2 to be able modify the schema in the database1, without losing all the datas.
The we will recopy the data from database2 to database1, modified by an xsl in order to match the xml with the schema change.
srcDataCollectionCommand is the command connected to the database1
destDataCollectionCommand is the command connected to the database2
docType is the doctype (without the prefix) of the documents to copy
// Get all the ino:id and the ino:docname of the documents to copy
srcDataCollectionCommand.Connection.Open(TaminoConnectionMode.AutoCommit);
response = srcDataCollectionCommand.Query(new TaminoQuery(“declare namespace tf=‘http://namespaces.softwareag.com/tamino/TaminoFunction’ for $all in input()/*[local-name(.)='”+docType+“'] return {tf:getDocname(root($all))}”),1);
srcDataCollectionCommand.Connection.Close();
// Put the relevant nodes in a list
XmlNodeList list = response.GetSinglePage().SelectNodes(“//value”);
string docName;
TaminoUri tamUri;
// ?? needed to avoid the timeout ??
System.Net.ServicePointManager.DefaultConnectionLimit = 20;
System.Net.ServicePointManager.MaxServicePointIdleTime = 500;
bool isInoIDDocName;
// Open connection to the source and destination databases (REM :I’v tried to put it in the loop bellow, but the problem
// is the same : timeout)
srcDataCollectionCommand.Connection.Open(TaminoConnectionMode.AutoCommit);
destDataCollectionCommand.Connection.Open(TaminoConnectionMode.AutoCommit);
// Loop through the relevant nodes
foreach(XmlNode node in list)
{
// Use ino:docname if available, other use ino:id as document name
if(node.HasChildNodes)
{
docName = node.InnerText;
isInoIDDocName=false;
}
else
{
docName = node.Attributes[“inoId”].InnerText;
isInoIDDocName = true;
}
// set the uri depending on the test above. If ino:id is used, add @ before the docname (i.e. ./contractX/@1)
tamUri = new TaminoUri(“./”+tamSchemaDoc.DocName+“/”+(isInoIDDocName?“@”:“”)+docName);
// Retrive the document (REM: The timeout occurs on this line on the 2nd code loop)
tamDataDoc=srcDataCollectionCommand.Retrieve(tamUri);
// If ino:id is used, tamDataDoc.DocNam == @nbre (i.e. @1). An exception is thrown with this docname.
// → Replacing the tamDataDoc.DocName (i.e. @1) with the docName used for the retrival operation (i.e. 1)
tamDataDoc.DocName = docName;
// Insert the retrived document. (REM: If this line is commented, no timeout occurs)
destDataCollectionCommand.Insert(tamDataDoc);
}
// close both connections
srcDataCollectionCommand.Connection.Close();
destDataCollectionCommand.Connection.Close();
thanks for your help
#webMethods#API-Management#webMethods-Tamino-XML-Server-APIs