if (xQuery != null) {
qr = find(connection, theDb, xQuery, "", ServerCommand.find_SORT, adjacency, 0, null);
docNumber = getNumDoc(connection, theDb, qr, 0);
}
if (docNumber != -1) {
XMLCommand theCommandLoad = new XMLCommand(XMLCommand.LoadDocument, XMLCommand.LoadDocument_Lock, docNumber);
String xDoc = XMLCommand(connection, theDb, theCommandLoad.toString());
theLock = XMLCommand.getLockCode(xDoc);
}
XMLCommand theCommand = new XMLCommand(XMLCommand.SaveDocument, XMLCommand.SaveDocument_Save, docNumber, xmlToInsert, thePne, thePnce, theLock);
String result = "";
result = XMLCommand(connection, theDb, theCommand.toString());
if (result.indexOf("dtl") == -1) {
throw new XWException("An Error occurred while processing insert/update");
}
}