I'm developing a JAVA system with JSF, PrimeFaces and Hibernate with Mysql database. In this system the user must inform the login the bank that wants to connect (User, password and bank). The problem is that when the user calls the Login screen Hibernate already starts the session manufacturing before the user reports the connection data. I would like to know if Hibernate has a way to only start the session factory after the user clicks Logar.