2 Replies Latest reply on Jul 13, 2007 11:15 AM by Paul Sideleau

    @Rollback annotation for validation logic causing detached o

    Paul Sideleau Newbie

      I have a stateful session bean that uses an extended persistent context and is annotated with @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED).

      In a transactional action method annotated with @TransactionAttribute(TransactionAttributeType.REQUIRED), I perform business level validation. If the validation fails, I rollback the transaction using Seam's @Rollback annotation.

      However, the EJB specs indicates that a rollback will cause all entities in the entitymanager to be become detached. This seems like overkill because then I need to merge back all the instances and allow the user to fix the validation errors.

      Are there any best practices with this? Should I only rely on using Hibernate validation with seam's s:validateAll tag?

      Thank you.