>the slave replication server does not seem to be recognized correctly
Could you elaborate on what do you mean by "does not seem to be recognized correctly"?
>jdbc driver thinks it is connected to a slave
pjgdbc uses "show transaction_read_only" query to tell master from secondary.
"readOnly=true" connection option is used/activated _after_ the connection, so it should not impact master/secondary selection.
PS. There's 10 second-long (hostRecheckSeconds) cache of the host status. That is, pgjdbc caches master/secondary state of the host for 10 seconds by default, so it might "fail" to identify recently activated secondary.
Vladimir