java - why hibernate no update field? -


i'm updating field in hibernate oracle database, doesn't. why hibernate doesn't update field leido?

    if (mensajeid.getleido().equals("false")) {          transaction tx = main.getsesion().begintransaction();         mensajeid.setleido("true");         mensaje mensaje = listamensajesrecibidos.getselectedvalue();         mensaje.setid(mensajeid);         mensaje.setusuariobyemisor(mensaje.getusuariobyemisor());         mensaje.setusuariobyreceptor(mensaje.getusuariobyreceptor());         main.getsesion().update(mensaje);                    tx.commit();     } 

it seems try use update() method not managed instance. should use saveorupdate() or save() in case.

if think entity in db instance not connected session should use merge() before.


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -