This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I see that in the class UserAction, there is a call to dao.isUsernameRegistered(username) to check the name first before inserting a new user into the table. But, as far as I know, JForum runs in a multithread environment. What if when two different threads check if there is such a user with the name, say 'adam', in the table at the same time, and they both get false as the answer, and then they both insert a new user with 'adam' as name into the table JFORUM_USERS? How does JForum prevent this kind of thing from happening?