Java project with hibernate and client/server threads