문제

I am using a @ConversationScoped CDI to manage my form. Now, when loading a page, the entity is searched using JPA. I bind this entity directly onto my bean and accessing is like:

<h:inputText value=#{myForm.myEntity.name}/>

The problem is that it seems to be managed all the time, even if I do a

em.detach(myEntity);
myForm.myEntity = myEntity;

when binding the entity to my bean. Without a merge, the entity is updated in the underlying database.

What's going on there? Do I really need a deep copy of my object?

Is this probably an erroneous way to use CDI beans?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top