If using the JDBC connector as part of a MariaDB/Galera management tool, it is not possible to connect to a non-primary server to query or force it to go primary.
This is due to the driver, internally, issuing a select command upon connection, which returns an exception as "data access" is not allowed whilst non primary. Only SHOW and SET are allowed on non primary nodes.
This prevents the connection from being returned to the caller.
In 1.2 versions, the driver issued: