I want to insert about 50 documents into Tamino in one action,is it possible using the TaminoApi?is there an alternative way doing that whithin my java code?
Try giving a thought of using Java Mass Loaders found under X_Tools folder of ur Tamino Installation.
I dont’ think so, ‘insert’ method of TXMLObjectAccesscor enables you to take multiple TXMLObjects.
Anyways, a small test would place all of your XML documents under a single file, and try to create a TXMLObject out of this file, and try to insert this. There might be three outcomes
1. Data might get inserted.
2. It might end with a DOMHierarchyError.
3 TInsertException, as the data is not valid as per the Schema defined.
Just a thought,
At least the Tamino HTML API (X-Machine) _process command also accepts multiple documents in one go. So for example the new Tamino API for C, which basically exposes the x Machine commands, is able to process multiple documents in one call. you can’t do this on higher level object oriented APIs, like the Tamino API for Java.
Excerpt from the X-Machine programming documentation:
The _process command
The _process command is used to store a new object into a Tamino database or to modify an existing object.
It is also possible to load or modify multiple XML documents with a single _process command if the documents are concatenated in the format used by the Tamino Data Loader. See the documentation for The Tamino Data Loader for details of this format (Tamino XML Server > The Tamino Data Loader)
The HTML API does enable multiple documents insertion(Interactive interface for example),so i thought i won’t have a problem doing the same with the java api,i guess i can’t.
Will have to check the data loader option,meantime i have a loop version working pretty well.
If we take it as a performance issue,what is better:insertion of 50 documents(or any other reasnoable amount) in one insert action or doing that one by one within a loop?in what conditions one should’nt use multiple documents insertion?
[This message was edited by Guy Sh on 18 Jun 2003 at 15:43.]
The Loop option is always there for the insertion of the multiple documents if no other option is left out. But as you also pointed out, it would be a performance block for doing so, and mainly if your application is in some sort of batch processing like
i) first insert all the N documents into the database (think of N as a pretty huge number)
ii) then analyze all your documents for some application based conditions
The analysis part of your application is halted until you insert all your documents.(Just a hypothetical example)
It would have been a nice feature if TaminoAPI4J provides Batch Wise Inserts.