The documentation for system.db.beginNamedQueryTransaction fails to mention that an argument for ‘project’ is required when running in the gateway scope.
database = 'DB' isolation = system.db.READ_COMMITTED timeout = 1000 project = 'global' tx_query = system.db.beginTransaction(database, isolation, timeout) tx_namedQuery_noProject = system.db.beginNamedQueryTransaction(database, isolation, timeout) tx_namedQuery_project = system.db.beginNamedQueryTransaction(project, database, isolation, timeout)
Results in Gateway Scope:
'12425fc9-7d1a-4f24-b494-c5f4c242efc1' None 'ba8fc790-ea64-4dd0-abc3-0c96a1a606f2'
Results in Client/Designer Scope:
Traceback (most recent call last): File "<input>", line 8, in <module> TypeError: expected at most 3 arguments, got 4
The documentation in question: https://docs.inductiveautomation.com/display/DOC80/system.db.beginNamedQueryTransaction
Why is the project name required at all to begin a named query transaction?
What’s the logic behind the differences in named query functions between gateway/client scopes? It would make everything simpler if ‘project’ was an optional parameter in the client scope.