glassfish
  1. glassfish
  2. GLASSFISH-20530

PSR:FUNC Scrumtoys sample incorrectly handles transaction

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 4.0_b88_RC4
    • Fix Version/s: None
    • Component/s: sample_apps
    • Labels:
      None

      Description

      We are using the standard scrumtoys JSF sample. Somewhere around build 83 (I haven't narrowed it down exactly – but I'd guress around the eclipse promotion in late April) this sample no longer works – when we create a project, it should be persisted, and then appear in the project list. Instead, the project list comes up empty.

      I am attaching the war file we are using. The domain is created like this:
      asadmin create-domain jsf
      asadmin start-domain jsf ../bin/asadmin create-jdbc-connection-pool --datasourceclassname org.apache.derby.jdbc.EmbeddedXADataSource JSFPool ../bin/asadmin set server.resources.jdbc-connection-pool.JSFPool.property.connectionAttributes=create=true
      asadmin set server.resources.jdbc-connection-pool.JSFPool.property.databaseName=jsf
      asadmin create-jdbc-resource --connectionpoolid JSFPool jdbc/jsf

      Click on the project tab, then click create new project, enter a name and date and click create project. The resulting screen then should have a list of the one project that was just created (which is what happens in previous builds).

      I have put debugging statements in the code where the transaction is created:

      public abstract class AbstractManager {
      @PersistenceUnit private EntityManagerFactory emf;
      @Resource UserTransaction ut;

      protected void do()

      { // Exception handling deleted EntityManager em = emf.createEntityManager(); ut.begin(); System.out.println("User transaction begins for " + em); System.out.println("Calling EM persist of " + getCurrentProject() + " on " + em); em.persist(getCurrentProject()); System.out.println("Done calling EM persist of " + getCurrentProject() + " on " + em); ut.commit(); System.out.println("User transaction committed for " + em); }

      }

      We get essentially the same output of this in build 88 (where it fails) and build 76 (where it succeeds):
      [#|2013-05-14T10:42:16.118-0700|INFO||javax.enterprise.logging.stdout|_ThreadID=17;_ThreadName=http-listener-1(1);_TimeMillis=1368553336118;_LevelValue=800;|User Transaction begins for org.eclipse.persistence.internal.jpa.EntityManagerImpl@43b8170f|#]

      [#|2013-05-14T10:42:16.118-0700|INFO||javax.enterprise.logging.stdout|_ThreadID=17;_ThreadName=http-listener-1(1);_TimeMillis=1368553336118;_LevelValue=800;|Calling EM persist of Project[name=j8,startDate=Mon May 13 17:00:00 PDT 2013,endDate=Wed Jun 12 17:00:00 PDT 2013] on em org.eclipse.persistence.internal.jpa.EntityManagerImpl@43b8170f|#]

      [#|2013-05-14T10:42:16.120-0700|INFO||javax.enterprise.logging.stdout|_ThreadID=17;_ThreadName=http-listener-1(1);_TimeMillis=1368553336120;_LevelValue=800;|Done Calling EM persist of Project[name=j8,startDate=Mon May 13 17:00:00 PDT 2013,endDate=Wed Jun 12 17:00:00 PDT 2013] on em org.eclipse.persistence.internal.jpa.EntityManagerImpl@43b8170f|#]

      [#|2013-05-14T10:42:16.171-0700|INFO||javax.enterprise.logging.stdout|_ThreadID=17;_ThreadName=http-listener-1(1);_TimeMillis=1368553336171;_LevelValue=800;|User Transaction committed for org.eclipse.persistence.internal.jpa.EntityManagerImpl@43b8170f|#]

        Activity

        Scott Oaks created issue -
        Scott Oaks made changes -
        Field Original Value New Value
        Tags PSRBUG
        Scott Oaks made changes -
        Summary PSR:FUNC Entities are not persisted in embedded derby PSR:FUNC Scrumtoys sample incorrectly handles transaction
        Assignee michael.y.chen [ michael.y.chen ] Joe Di Pol [ jfdipol ]
        Component/s sample_apps [ 10617 ]
        Joe Di Pol made changes -
        Assignee Joe Di Pol [ jfdipol ] Snjezana Sevo-Zenzerovic [ snjezana ]
        Scott Oaks made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Duplicate [ 3 ]

          People

          • Assignee:
            Snjezana Sevo-Zenzerovic
            Reporter:
            Scott Oaks
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: