3 Replies Latest reply on Apr 4, 2006 4:46 AM by littlesuns

    Managed entity bean and database synchronization

    mirko27

      Seam makes every bean, which property is bound to UIComponent a managed bean. But managed beans do not synchronize themselves automatically to the database. Which is preferred way to synchronize entity bean to database in Seam?

        • 1. Re: Managed entity bean and database synchronization
          gavin.king

          If you do your work inside a conversation, and use an extended persistence context in an SFSB, or a seam-managed extended persistence context, then the entity bean will remain in the managed state for the entire conversation and will be automatically flushed to the database.

          • 2. Re: Managed entity bean and database synchronization
            mirko27

            Well,it does just not work.
            I have current user entity bean in conversational context and all
            it`s properties are bound to input components as follows:
            <h:form>
            <h:inputText value="#{current.firstname}"/>
            <h:commandLink action="justcomebackinthispage"/>
            </h:form>

            When I change the firstname property, next time page is rendered the firstname is changed. Also seam debug page shows that bean 'current' is changed.
            But database table row mapped to this entity bean does not change.
            Or are they flushed after conversation end?

            • 3. Re: Managed entity bean and database synchronization
              littlesuns

              not flush,but the value binding to the component was changed if you submit the form