How to block 2 users on the same screen-JAVA

I need to block the access of 2 people on the same screen, example, two people try to access the registration of a particular product, the second person who tries to enter must receive a warning that someone is accessing this registration. Would anyone have any ideas? I work with java, JSF, primefaces and hibernate.

Author: Leandro Santos, 2018-07-06