I got a table with a string field and try to update this field and the merge the update to the database via EntityManager. This is done and without exceptio but I see no effect on the database and ran out of ideas what's up there. Hope somebody has an idea. In the below exampl match != null
and with both print statements I get the expected value written to my log. But the merge within the transaction has no impact on the database even though the commit terminated.
@Named
@SessionScoped
@ManagedBean
public class LoginController implements Serializable {
@PersistenceUnit
private EntityManagerFactory emf;
public String mymethod(){
...
match.setPwdResetId(rs);
System.out.println("reset it is now "+match.getPwdResetId());
try{
ut.begin();
emf.createEntityManager().merge(match);
ut.commit();
}
catch(Exception e){
FacesMessage m2 = new FacesMessage("Values could not be saved. ");
FacesContext.getCurrentInstance().addMessage("ResetForm", m2);
System.out.println("exceptio persisting "+e);
return "message.jsf";
}
System.out.println("reset it is now2 "+match.getPwdResetId());