code: func (r *GormWorkItemLinkRepository) acquireLock(spaceID uuid.UUID) error {
  	// hash the UUID to get a 32 bit value from a 128 UUID that we can then use
  	// with a PostgreSQL advisory lock.
  	//
  	// TODO(kwk): Reducing the 128 bit UUID to a 32 bit number potentially ends
  	// up in longer wait times for locks because there exists a certain
  	// potential to have hash collisions for two distinct UUIDs. But currently
  	// Postgres only allows for 64 bit numbers without the high bit set. That
  	// effectively limits us to just 32 bit hashes. Once we allow cross-space
  	// linking we need to revisit the locking.
  	h := fnv.New32()
  	h.Write([]byte("links-" + spaceID.String()))
  	key := h.Sum32()
  
  	db := r.db.Exec("SELECT pg_advisory_xact_lock($1)", key)
  	if db.Error != nil {
  		return errs.Wrapf(db.Error, "failed to acquire pg_advisory_xact_lock(%d)\n", key)
  	}
  	return nil
  }
docs: // acquireLock takes a space ID and acquires an advisory lock. It blocks until
  // it acquires the lock.