There are actually three different types of inserts:
1) Normal inserts are what you want -- they insert the data and return
errors to the application.
2) Soft inserts also insert the data, but do not return errors to the
application on the assumption that these are due to attempting to insert
a row with a duplicate key. Use these when you aren't sure if the data
is already in the database and just want to make sure it is.
(An obvious flaw with soft inserts is that other things besides
duplicate keys can cause errors. The problem is that drivers are not
consistent about the SQLSTATEs they return, so there is no way a generic
application like XML-DBMS to trap these other erros. However, if you
know you are working with a single driver, you can modify to code to
trap only those errors you care about.)
3) Update-or-inserts first attempt to update the row. If the row is not
found, they insert it.
You choose which type of insert you want by specifying it in an action
document (see actions.dtd for details) or by passing it directly to the
storeDocument method in DOMToDBMS (see the JavaDocs for DOMToDBMS for
By the way, thanks for your other comments about unclosed statements.
The problem here is how to balance statement pooling with having too
many open statements. Clearly, the current code isn't working ...
> If I am understanding the xml-dbms code correctly, it attempts to do
> an update to a table and if no row exists, insert the data. I need
> to know if there is a way to call xml-dbms to do a straight insert
> without checking for an update first? The application I am
> developing will always do inserts, never updates and I would like to
> avoid the overhead of checking for updates first.