code: private void setConnectionReadOnly(Connection connection, boolean readOnly) {
          if (supportsReadOnly) {
              try {
                  connection.setReadOnly(readOnly);
              } catch (Throwable th) {
                  logger.info("Read-only connections not supported ({})", th.getMessage());
                  supportsReadOnly = false;
              }
          }
  
      }
docs: /*
  Set the read-only state of the connection.  If the connection throws an
  exception, record this, and don't attempt to change the state in future