I'm reading the source code of JForum v2.x.x from
http://jforum.net/.
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?
Thanks in advance!