Stored procedure call not using default database?

I've been fighting with a stored procedure this afternoon. The tag change script I'm writing preps the call, registers the in/out parameters, then executes it. The prepare statement looked like:

call = system.db.createSProcCall("MyProc")

It took me a while, but I finally noticed this buried in the error stack: java.lang.IllegalArgumentException: Cannot find database connection - name cannot be empty

The documentation for createSProcCall says, "The name of the database connection to execute against. If omitted or "", the project's default database connection will be used. [optional]", so I didn't think I needed to specify the database connection name. Once I added that, it worked.

Am I misunderstanding how this is supposed to work? This is on Ignition 8.3.0.

Tag change script, or tag event script?
Different scoping implications/rules depending on which one you're using (configured in Gateway Events or configured directly on the tag).

That said,

Update ASAP. There's a bunch of reasons for this, but really, 8.3.6 as soon as you can.
I don't know off the top of my head if this is also one of those reasons, but it's the first thing our support department is going to ask you to do too.

Tag change script, or tag event script?

Tag event script on the tag itself, Value Changed event.

And sorry, this is actually 8.3.6 on my development machine.

Tag event scripts run in the context of the 'gateway scripting project', and should be looking up the default database from there, if it's specified in that project's properties.
They do not automatically get the contextual local project like most other scripts in Ignition.

And you really should not be making DB calls from a tag event (on the tag). You are risking complete lockup of tag event scripting if multiple event scripts try to use a broken/overloaded DB connection.

I hadn't considered that. I'll move this into a Tag Change Gateway Event. I think each one of those runs in its own thread.