Cannot update ?

Dear all,

I’ve made a simple TJDOMObjectModel XQuery (see the below captured code)
but the result doesn’t contain Ino:ID which makes the update failed (error message below)

But there are 2 cases that the return result contains Ino:id (xmlObject.getId())
1.) if using TDOMObjectModel (not TJDOM)
2.) compile & run on another PC, using Java 1.4 (I can’t explain what’s the difference !!!)

is it a TaminoAPI4J.jar related issue ?

Any one has seen this kind of problem before ?
I read through the archives, just find that the XQuery return result is not guaranteed to have ino:id … is it still the case ?

Thanks everybody !


----- >8 -------
tcon = TConnectionFactory.getInstance().newConnection (tamServerURL, tamUsername, tamPassword) ;

TXMLObjectAccessor tacc = tcon.newXMLObjectAccessor (
TJDOMObjectModel.getInstance() ) ;

tcon.setIsolationDegree(TIsolationDegree.COMMITTED_COMMAND ) ;
tcon.setLockMode(TLockMode.PROTECTED) ;
tcon.setLockwaitMode (TLockwaitMode.YES) ;

TResponse tamResponse = tacc.query (xQuery) ; // make the query
TXMLObject xmlObject = tamResponse.getXMLObjectIterator().next() ;

// modify xmlObject

tacc.update(xmlObject) ; // <-- failed due to no ino:id ?!
----- >8 -------

----- >8 -------
com.softwareag.common.instrumentation.contract.ViolatedPrecondition: Violated Precondition: Update not possible. TXMLObject instance does not contain an ino:id!
----- >8 -------

I get a problem about update().

I want update an element not a document,What can I do?

thank you.

By default xquery will not return the ino:id unless you formulate the xquery expression to do so. One possibility is to use the XQuery-Update feature to update individual element(s) and attribute(s). Take a look at FLWUExpr expressions in the XQuery section of the Tamino documentation.

Hope this helps.