I have a managed SessionScoped bean (UserInfoController) with an Injected Session without a bean (UserInfoService).
UserInfoController calls UserInfoService to update UserInfo entries. UserInfoService loads the corresponding UserInfo entry, modifies it, and finally calls em.flush ();
When a managed bean UserInfoController is annotated with a CDI annotation (javax.enterprise.context.SessionScoped), the user record is not updated unless an administrator of entities without a bean state is annotated with PersistenceContextType.EXTENDED.
When a managed bean is annotated with a JSF annotation (javax.faces.bean.SessionScoped), the record is successfully updated using PersistenceContextType.TRANSACTION.
Can anyone explain this behavior? Should the transaction boundary be limited to a bean, regardless of whether the caller is JSF managed or a CDI SessionScoped bean? (TransactionAttributeType is undefined: it should default to NECESSARY)
Any information would be greatly appreciated! Thank you Ben
source share