Changes don't stick?

I am new to Tamino, and still trying to figure things out. One thing that I’m having trouble with is writing changes to some documents. Specifically, these are either attribute replacements or inserts.

What happens is that they appear to succeed. I can then hit the database with an XQuery or externally via a web app. Either way, the change appears to be applied. But a few minutes later, it reverts to the original value, rolling back my change.

Why is it doing this? What can I do to make it stick? I didn’t read anything about committing transactions in the documentation. Help.

Here are two examples:

Hi,

seems as if you do these changes in a transaction and never send a commit. In this case, the transaction is timed out and rolled back. So how do you send your queries to Tamino?

regards

Harald

Well that’s the point. I didn’t knowingly embed these in a transaction. But even more, why would it appear to commit them for a time if that was the case? If the transaction doesn’t complete, they should never appear in the database.

That point aside, I’m doing these in the XQuery tool. Shouldn’t I be able to expect that to do the right thing? Or am I missing something?

Thanks much.

This is a rather urgent issue. If someone could lend me a clue I’d really appreciate it!

I did a bit of quick testing with my local database and could not reproduce the behaviour you describe using either the Tamino XQuery tool or the Tamino Interactive Interface. Once an update was completed, it stayed put.

However, the number of instances per pack option does affect the transaction created.

When the tool executes, it reports each document’s ino:id that was updated. If there are more documents in the set to be updated than the XQuery tool is showing, then the transaction is not complete. Thus, if you have the default of “5 instances per pack” on the tool and there are more than 5 documents to be updated, the transaction will never be completed. Increase the instances per pack to include all the documents in the transaction.

see the Tamino documentation under the XQuery tool at file:///C:/Program%20Files/Software%20AG/Tamino/Tamino%204.2.1.1/X_Tools/X_Plorer/Documentation/xplorer/xqtwork.htm#xqtwork-execute

If your queries do not specify a transaction isolation level that prohibits “dirty reads”, then Tamino will return uncommitted updates. XQuery tool and Tamino Interactive Interface do perform “dirty reads”. You can write an application program using a Tamino API and specify the transaction isolation that your application needs.

It looks like the XQuery tool is set to do 500 instances per pack.

I’ll try with a lower number. If that doesn’t work, I’ll try programmatically.

I was just hoping that this was a known issue.

Setting instances to 5 did not change the behavior.

Is XQuery supposed to be able to make permanent writes to the database?

Of course, changes are to be permanent. With the level of detail known so far, no further analysis of the effect you notice is possible.
First of all: which version of Tamino do you use?
Have you tried the update with Tamino Interactive Interface as well? And the effect also occurs?
How many documents match the selection criteria specified in the query?

Regards

Harald

Hello,

I got the following information from an expert in this area:
the XQuery tool opens a Tamino connection before it sends XQuery statements to the database. This causes a transaction to be opened,
which, however, is closed only if you exit the tool. If you don’t, the transaction eventually is rolled back, and your changes are gone.
This behaviour is not related to XQuery, but to the tool, so if you use e.g. the Tamino Interactive Interface, you will not face the effect.

Regards

Harald

Harald, thanks. That might explain what is happening.

The most interactive interface I have is the XPlorer and XQuery, unfortunately. I didn’t install this installation, and the person who did is no longer with the company. I only have limited resources to work with, including finding out licensing, since this database was originally installed “under the table”.

The reasons the information above might appear vague are that I am unfamiliar with Tamino, and the problem seems very general: writes to the database roll back when written with the XQuery tool. Trying a few dissimilar queries that update the database, having them all rolled back in the same fashion, indicated to me that it was a general problem with my approach, rather than a specific problem with the individual query. The Tamino version in question is 4.1.4.1.

That said, I’m trying to use the tools I have available.

The queries above are very representative of what I’m trying to do. They generally update one to a few records at a time. The number was always less than ten.

I spent all of yesterday writing a couple programs to do this, and they succeeded.

If this comes up again, I’ll try closing out the XQuery after writing changes to see if that makes a difference.

Thanks again for your help.

I’m using the XQuery Tool (V 4.2.1.1) to execute update statements. I have the same problem outlined in this post, the transactions roll back.

Yes, I see that I can exit the tool, which does a disconnect to force the commit, but that sounds like a hack to me.

  1. How can we set up the XQuery Tool session in session-less or auto-commit transaction mode?

  2. How do we enter an explicit commit in the XQuery Tool, when executing an update statement?

Thanks.
Kim

Hi,
please use the update package 4.4.1.3 which fixes this problem.
Regards,
Gerald