Dears,

I'm developing a game and want the Board object to be available to the players playing on it.

So far so good for 1 game at a time, but I've already encountered the following problem:

When calling:

```
@GetMapping({ "/judge/" })
public String judge(Model model,
        @RequestParam(value = "id", required = true, defaultValue = "World") final String hash) {

    ColorsTaken user = colorsTakenRepository.findByHash(hash);

    Board board = BoardController.getInstance().getBoard(gameHash);

    ...

    model.addAttribute("board", board);
    model.addAttribute("user", user);

    return "judge";

}

```

Concurrent calls to judge(...) were interfering and a call of player A to judge(...) rendered the call that player B was doing at the same time...

I "solved" this issue by using a ReentrantLock and locking the call until the judge.jsp was rendered but this is far from an elegant solution...

Furthermore, once there would be different concurrent games the:

```
board.getLock().lock();

```

call will pass through if a different board object are used and making the lock static is an alarm bell that I shouldn't go on with this "solution"...

(There is also the method:

```
@GetMapping({ "/board/" })
public String board(Model model,
        @RequestParam(value = "id", required = true, defaultValue = "World") final String hash) {

```

which renders the board,

if I'd use a static ReentrantLock for these calls all of the players would need to wait until all of the concurrent boards are rendered which isn't a good solution at all...)

(If there are 100 concurrent games 100 \* 4 people would need to wait until all of the boards are rendered and this is simply wrong...)

Now, what should I do instead?

The Board object should be shared among the 4 players (any change to it should be available to the other players) but player A of game 1 should not be aware of player F of game 2, but (of course) all changes to game 1 should be available to player B, C and D of game 1...

The code I showed is from a:

```
@Controller
public class HelloController {

```

Which architecture should I use to not have to rely on ReentrantLocks?

Best regards and thanks,

S.