Unless your post is missing crucial code/info, the SQL update you posted is atomic and should work even with concurrent processes updating the same row. No need of %NOLOCK or retry (is that second update a retry?).
It will not be atomic if you use %NOLOCK.

If you want to use object code to update ProcessedCount, then:

Set obj=##class(Data.A).%OpenId(RowID,4)
Set obj.ProcessedCount=obj.ProcessedCount + 1
Set sc=obj.%Save()
; handle error here
Kill obj

I feel your post/code misses some info.

Also, what do you mean with "not working"?

 

I think that ^ZAUTHLOG cannot be set because the process executing the ZAUTHENTICATE code has no privilege/access to %SYS for writing. If you follow the @Lucas Fernandes suggestion to enable and check audit log you probably find a <PROTECT> error.

If you are using a test system (no production!), you can temporary add %All role to the CSPSystem user and try again.
Remember to remove the %All role after your debug the issue.

Note that before authentication the process running ZAUTHENTICATE has VERY limited capabilities (privileges).

In general I think the ZAUTHENTICATE  should check if it's called for the purpose you are implementing, something like:
 

If ServiceName="%Service_WebGateway" {
	If $isobject($get(%request)) {
		If (%request.Application="/ws/jarvis") {
			
			; your code here
			
		}
	}
}

You may also need/want to assign a role to the user:
Set Properties("Roles")="YourRequiredRole"

I'm afraid I don't have an answer, I use JDBC regularly (admittedly , not Postgres and NOT using %XDBC classes) and I've never seen this behavior.
If anyone wants to dive deeper in this issue, more information are required to analyze and maybe try to reproduce it, like:

"....rapid increase in memory consumption by the IRIS server" What process is consuming memory? 
What OS, Windows or Linux? If Linux, what flavor?
What Java version are you using?
What version of Postgres  JDBC driver are you using?

Last but to least, note that class %XDBC.Gateway says:
"FOR INTERNAL USE - do not invoke directly"

LoadPageDir() compiles the subdirectories as well if/when in the Web Application definition the setting "Web Settings: Recurse" is flagged (enabled). (It's flagged/enabled by default when creating a Web App)

How is Recurse setting set in your "/CSP/ourapp/" Web Application definition/configuration?

Note that the directory you pass to LoadPageDir is in fact the path of a Web Application, not the physical path on disk.

I'm afraid it's not correct, for example the first item:

For ResearcherId the parretn 1N means "One Number", EXACTLY one number

I think the correct pattern should be .N, this means any number of Number (digits).

Supposing ResearcherId  is  mandatory and my contains only numbers (at least one), the the pattern would be 1.N

Last name would be 1.A, that is at least one low/upper case character