public boolean addUser(String username, String password) {
EntityManager entityManager = entityManagerFactory.createEntityManager();
final EntityTransaction transaction = entityManager.getTransaction();
try {
transaction.begin();
JPAUser user = new JPAUser(username, password, algo);
entityManager.persist(user);
transaction.commit();
return true;
} catch (PersistenceException e) {
logger.debug("Failed to save user", e);