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

CMT vanishes when using Servlets and Seam Transaction

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1.0.Final
    • Fix Version/s: None
    • Environment:

      Win7, Glassfish 3.1.2.2, Mojarra 2.1.14, Weld 1.1.8, Seam 3.1.0

    • Steps to Reproduce:
      Hide

      Fetch the attached project.
      Create the derby instance/table/record as shown in /database/create.sql
      Deploy the project and hit http://localhost:8080/testEjbWeb/myServlet
      You can see the value of the record in the DB being incremented and the updates being flushed by Hibernate.

      Now uncomment the seam libs in the pom.xml, start over: the value doesn't increment anymore.

      Show
      Fetch the attached project. Create the derby instance/table/record as shown in /database/create.sql Deploy the project and hit http://localhost:8080/testEjbWeb/myServlet You can see the value of the record in the DB being incremented and the updates being flushed by Hibernate. Now uncomment the seam libs in the pom.xml, start over: the value doesn't increment anymore.
    • Workaround Description:
      Hide

      Manage TXN's manually, or move to JSF instead of using Servlets.

      Show
      Manage TXN's manually, or move to JSF instead of using Servlets.

      Description

      When Seam Persistence/transaction is installed and calling from a SERVLET an EJB business method that performs em.persist/merge, tranasaction management is gone, thus statements are not executed.

      I read carefully these:
      http://docs.jboss.org/seam/3/persistence/latest/reference/en-US/html/persistence.html#d0e68

      By default seam will attempt to look up java:comp/UserTransaction from JNDI (or alternatively retrieve it from the EJBContext if a container managed transaction is active).
      ==>This is obviously not correct if you try with the attached example.

      I tried to use a SMPC, to no avail.

      Then I read this https://community.jboss.org/thread/178844
      Without much hope, I tired to use ?cid=#

      {conversation.id}

      with the servlet url, to no avail.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                fabmars Fab Mars
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: