Transaction Datasource Unknown

Hello All,

I am trying to use transactions in my script when updating and inserting. But I am getting the above error. Transaction Datasource Unknown when my code tries to execute system.db.runUpdateQuery. I am using the documentation from system.db.beginTransaction and system.db.runUpdateQuery but I must be missing something. For example, when I start my transaction, I am using this:

txId = system.db.beginTransaction(database="my_database",isolationLevel=1,timeout=5000)

and that seems to work ok. But when I try to run an update query:

rowsUpdated = system.db.runUpdateQuery("my_update_query",database="my_database",tx=txId,getKey=0,skipAudit=0)

This error appears:

java.lang.Exception: java.lang.Exception: Error executing system.db.runUpdateQuery(my_update_query, Transaction datasource unknown, 7cebc364-b0d8-481f-99a5-acdde18cf3bf, false)

What the heck am I missing?

Thank you for the help!

I use transactions when I'm coordinating multiple queries, and it has always seemed to work well, but I haven't ever used equal signs in the command, so perhaps that is the issue. My transactions typically look something like this:

query1 = "SELECT max(`Column1`)+'%s' FROM some_table"
query2 = "INSERT INTO some_table (`Column1`, `Column2`) VALUES ('%s','%s')"
serialTx = system.db.beginTransaction('myDatabase',timeout=5000)
arg1 = '1'
arg2 = system.db.runScalarQuery(query1 %(arg1), 'myDatabase', serialTx)
args=arg1, arg2
system.db.runUpdateQuery(query2 %(args), 'myDatabase', serialTx)