HBNContainer Problem

hi, i’m trying to use hbncontainer for the first time, i list correctly what i need, but i can’t seem to use the update method provided by the container, in one case, it does nothing, in the other case, it throws errors that shoudn’t happen, specifically in the updateEntity method. In the code examples i’ve seen nobody uses those methods, they update or create directly from hibernate session, but what is the point of those methods if nobody uses them, and they don’t seem to work???
[b]

Code (doesn’t work):
[/b]

Tbuser us = hbncont.getItem(itemId).getPojo();
hbncont.updateEntity(us);
				
//HibernateUtils.getInstance().updateUser(us);
userForm.commit();


Error:

Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [cu.uci.datec.gdr.core.modell.Tbuser#2]

at org.hibernate.engine.internal.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:689)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:293)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:239)
at org.hibernate.event.internal.DefaultUpdateEventListener.performSaveOrUpdate(DefaultUpdateEventListener.java:55)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
at org.hibernate.internal.SessionImpl.fireUpdate(SessionImpl.java:779)
at org.hibernate.internal.SessionImpl.update(SessionImpl.java:771)
at org.hibernate.internal.SessionImpl.update(SessionImpl.java:767)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:352)
at $Proxy18.update(Unknown Source)
at com.vaadin.data.hbnutil.HbnContainer.updateEntity(HbnContainer.java:694)
at cu.uci.datec.gdr.core.visual.UsersAdmin$4.buttonClick(UsersAdmin.java:293)

And i have another problem, this one really serious, i’m using a form to update that data, sometimes when i save, it throws the event and do nothing, other times it does what it needs, other tiemes, it loads outdated data on the form.

Regards

the problem was that hibernate container correctly opens the session for hibernate and do all the work, but it doesn’t commit the transaction or closes the session, so you have to do that manually.
And it’s done