1 Reply Latest reply on Jan 2, 2009 5:34 PM by Vadim Berezniker

    selectManyItems requerying each item

    Vadim Berezniker Newbie

      Seam 2.1

      On the view I have something like this:

      <h:selectManyListbox id="listmany" value="#{bean.selectedItem}">                  
          <s:selectItems id="dl" value="#{bean.items}" var="curitem" label="#{curitem.name}"/> 
          <s:convertEntity />                                                          

      The backing bean is a session scoped seam component with seam managed persistence manager injected.
      When the view is loaded, the items list is loaded from the database.
      When the user selects several items and submits the form, a SQL query is then generated for each selected item (to load the item itself -- not lazy loading).
      I can't quite figure it why it's happening.

      Under a profiler it seems to be happening here:

        -- org.hibernate.ejb.AbstractEntityManagerImpl.find(Class, Object)

      I would appreciate your help.