Hi! There –
Let me introduce you all with the issue,
The XML document in the Tamino Database is pretty small, with about 2 ordinary elements and 2 elements which has CDATA Sections. Well, depending upon the some ID value I need to update one of the CDATA Section. To add more, these processing would be happening concurrently, for many Tamino Connections, as these updations are issues to a Data Access Objects, whenever a MDB is notified.
These are the list of the problems/issues I faced during the update of the XML document.
1. Under concurrent operations, I am getting an error message something like “(The Requested document(s) could not be locked)” with the error code INOXYE9155. Does anyone has tested Tamino 4.1.1 in a MDB environment with a many database hits, bascially for every onMessage() notification, 2 or 3 database calls are being made. I even tried with TLockMode set to YES for the upadate operations. But I guess, this would degrade the performance of the application.
2. I tried to update a particular inner element of DOM Element, as obtained from TRespone(I am using TaminoAPI4J and the Object Model is TDOMObjectModel). Well, the Element.getElementsByTagNames() doesnt’ seems to be working or not useful in this regard. (In one of the tamino forum its been adviced/suggested to use getElementsByTagName() rather than Node.getChildNodes().
Somemore information, even before someone asks me … “which one is your webserver”, let me tell you, It is Apache configured to use with Tamino 4.1.1
3. If I had to copy/replace the whole of XML document from the database, with a new one. would the meta informatiom like the ino:id, docname associated with the TXMLObject are lost?. I certainly dont’ think this is the right way to replace whole of the Document.
4. So I thought of using the XQuery instead. This is the following query.
update for $data in input()/SSData
let $sData := $data/SData
where $data/SID=71
do replace $sData/text() with
'<![CDATA[
<?xml version="1.0"?>
admin48
admin4887676
admin4884545
]]> '
This DOES updates the database, but the updated CDATA section, does not happens to be a CDATA section but its is more like any other normal String.
Could anyone suggest me in this regard as how to update a CDATA section with XQuery.
Thanks and Regards,
Ravi Chamarthy.
Hello Ravi,
could you please post the schema (and a document) you are using for SSData?
Which version of Tamino are you using for this - is it 4.1.1.9 ?
Thanks,
Trevor.
Hello Trevor,
Following are the Schema and the Sample file.
This is the sample Query…
update for $data in input()/SharpStatementData
let $stmtData := $data/StatementData
where $data/StatementID=1
do replace $stmtData/text() with
<![CDATA[
<?xml version="1.0"?>
admin48
admin4887676
admin4884545
]]>
data.zip (1.13 KB)
Hello Ravi,
after some playing around with this, I have also been unable to find a solution. The less-than and greater-than signs of the CDATA section in the update statement are converted to the corresponding entity references at some point in the process, so the document in Tamino looks something like this on retrieval (without any spaces in the entities):
<StatementData>
& lt ;![CDATA[ & lt ;?xml version=& quot ;1.0& quot ;?& gt ;
& lt ;StatementXML& gt ;
& lt ;Users& gt ;
& lt ;User& gt ;
& lt ;ID>admin48& lt ;/ID& gt ;
& lt ;First_Name& gt ;admin4887676& lt ;/First_Name& gt ;
& lt ;Last_Name& gt ;admin4884545& lt ;/Last_Name& gt ;
& lt ;/User& gt ;
& lt ;/Users& gt ;
& lt ;/StatementXML& gt ;
]]& gt ;
</StatementData>
Perhaps someone knows a way around this?
One thought that I do have in the back of my mind is: are you certain that you need to use a CDATA section?
For this particular example, you could model StatementData using an xs:any (rather than xs:string), and then store any XML structure directly within it (without the CDATA section).
I think that this approach would also allow for better searching possibilities on the structures stored within the StatementData element.
Greetings,
Trevor.
Trevor,
Thanks for trying out with the problem.
Yes, xs:any is what I am planning to try with.
Let me try with this out and tell you if I have any issues regarding with that.
Ravi.