Uploaded image for project: 'Seam Persistence'
  1. Seam Persistence
  2. SEAMPERSIST-67

LazyInitializationException threw when persist a Many to Many collection of an entity.

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Java 6 update 27, Seam 3.1.0Beta2, JBoss 7.0.1.Final

      Description

      I tried a saved a many to many relation(multicheckbox), but failed.

      But in before seam 2 application, I used like this, never encounter such a problem.

      I used Seam managed Persistence, and added TransactionIntercepter in the beans.xml.

      Please refer the discussion in the forum.

        Gliffy Diagrams

          Activity

          Hide
          lightguard Jason Porter added a comment -

          Ben, I strongly suggest not moving to Seam 3 as it is no longer under active development. Take a look at Apache DeltaSpike, or stick with Seam 2 by upgrading to Seam 2.3.

          Show
          lightguard Jason Porter added a comment - Ben, I strongly suggest not moving to Seam 3 as it is no longer under active development. Take a look at Apache DeltaSpike, or stick with Seam 2 by upgrading to Seam 2.3.
          Hide
          Ben.Maisano Ben Software Engineer added a comment -

          Hi Jason - thanks for the quick response. We started our migration last year before this announcement and are a far way in. We also wanted to start using CDI, JSF 2, and RichFaces 4 items without building more seam 2.3 items to just have to migrate at some future point. We have many things working on Seam3, this issue though we are having issues with. Does DeltaSpike solve this? DeltaSpike seems to be in beta, 0.4-incubating-SNAPSHOT, I do not think we can move there right now.

          I did not follow this thread, for the read operation only (no many to many editing), what was the solution?

          Show
          Ben.Maisano Ben Software Engineer added a comment - Hi Jason - thanks for the quick response. We started our migration last year before this announcement and are a far way in. We also wanted to start using CDI, JSF 2, and RichFaces 4 items without building more seam 2.3 items to just have to migrate at some future point. We have many things working on Seam3, this issue though we are having issues with. Does DeltaSpike solve this? DeltaSpike seems to be in beta, 0.4-incubating-SNAPSHOT, I do not think we can move there right now. I did not follow this thread, for the read operation only (no many to many editing), what was the solution?
          Hide
          lightguard Jason Porter added a comment -

          This one I think was due to a problem with the validation and not using the collectionType attribute in a collection. I'd need to see what you're doing to see if it's the same problem.

          Show
          lightguard Jason Porter added a comment - This one I think was due to a problem with the validation and not using the collectionType attribute in a collection. I'd need to see what you're doing to see if it's the same problem.
          Hide
          hantsy hantsy bai added a comment -

          Oh, my God, this discussion was posted 1.5 year ago.

          I think the collectionType is not the only problem.

          A big problem is the converter.

          I have read the codes of Seam 2 entityConverter, for the MultiSelectCheckBox/MultiList, it will convert between List<PK> and List<Entity TYPE>(and other types, such as Collection, Set, array).

          But the object converter in Seam 3 does not provides such a features.

          In fact, in the last two years, I have spent much time on JSF2/Richfaces4/Seam3 in projects, and some problems still can not be resolved.

          Personally, I had got every bad experience when use Richfaces 4 and Seam 3. And later, I gave up Richfaces 4 rich components, and used pure JSF+ Richfaces A4j+ Twitter Boostrap + Seam3.

          Now I am trying to give up JSF in new website based application, and use REST(backend)+JS/AngularJS(frontend) . I think in future I will use JSF in internal app or backend admin for some application.

          Hantsy

          Show
          hantsy hantsy bai added a comment - Oh, my God, this discussion was posted 1.5 year ago. I think the collectionType is not the only problem. A big problem is the converter. I have read the codes of Seam 2 entityConverter, for the MultiSelectCheckBox/MultiList, it will convert between List<PK> and List<Entity TYPE>(and other types, such as Collection, Set, array). But the object converter in Seam 3 does not provides such a features. In fact, in the last two years, I have spent much time on JSF2/Richfaces4/Seam3 in projects, and some problems still can not be resolved. Personally, I had got every bad experience when use Richfaces 4 and Seam 3. And later, I gave up Richfaces 4 rich components, and used pure JSF+ Richfaces A4j+ Twitter Boostrap + Seam3. Now I am trying to give up JSF in new website based application, and use REST(backend)+JS/AngularJS(frontend) . I think in future I will use JSF in internal app or backend admin for some application. Hantsy
          Hide
          Ben.Maisano Ben Software Engineer added a comment -

          Thanks Hantsy for the thoughts. We have a forms heavy highly customizable SaaS product that we find JSF very well suited for. I also think facelets is the best templating engine in then industry. EL expressions can be great for business rules that integrate into system easily. It's the rest I have issues with. Ajax is slow and does too much. Richfaces regions to solve this problem do not seem to work well. Transaction mgmt and scope/context issues are way to complex. They create problems larger than the ones they solve (flipping an auto commit flag off and having a managed map of named beans). I am really disappointed in the cross integration of lazy fetch in ORM/hibernate. It seams the design and idea is not even supported well without extra magic. JSF validation can be such a pain, just try to implement a "reset button" or do a "save for later" mechanism to let user save partial form without validation yet.

          As for Seam, it has the difficult combination of innovating around java spec limits but also influencing them, thereby guaranteeing migration issues in the future to standards. It also is way too invasive. We found only way out of Seam was to upgrade first so we can iteratively move to standard JSF 2 stuff.

          Show
          Ben.Maisano Ben Software Engineer added a comment - Thanks Hantsy for the thoughts. We have a forms heavy highly customizable SaaS product that we find JSF very well suited for. I also think facelets is the best templating engine in then industry. EL expressions can be great for business rules that integrate into system easily. It's the rest I have issues with. Ajax is slow and does too much. Richfaces regions to solve this problem do not seem to work well. Transaction mgmt and scope/context issues are way to complex. They create problems larger than the ones they solve (flipping an auto commit flag off and having a managed map of named beans). I am really disappointed in the cross integration of lazy fetch in ORM/hibernate. It seams the design and idea is not even supported well without extra magic. JSF validation can be such a pain, just try to implement a "reset button" or do a "save for later" mechanism to let user save partial form without validation yet. As for Seam, it has the difficult combination of innovating around java spec limits but also influencing them, thereby guaranteeing migration issues in the future to standards. It also is way too invasive. We found only way out of Seam was to upgrade first so we can iteratively move to standard JSF 2 stuff.

            People

            • Assignee:
              Unassigned
              Reporter:
              hantsy hantsy bai
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:

                Development