Issue Details (XML | Word | Printable)

Key: GLASSFISH-20530
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Snjezana Sevo-Zenzerovic
Reporter: Scott Oaks
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

PSR:FUNC Scrumtoys sample incorrectly handles transaction

Created: 14/May/13 07:00 PM   Updated: 15/May/13 08:50 PM   Resolved: 15/May/13 08:50 PM
Component/s: sample_apps
Affects Version/s: 4.0_b88_RC4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. File ScrumToys.war (798 kB) 14/May/13 07:00 PM - Scott Oaks


Tags: PSRBUG
Participants: Ed Burns, marina vatkina, Scott Oaks and Snjezana Sevo-Zenzerovic


 Description  « Hide

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|#]



Sort Order: Ascending order - Click to sort in descending order
Scott Oaks made changes - 14/May/13 07:01 PM
Field Original Value New Value
Tags PSRBUG
Scott Oaks made changes - 14/May/13 07:38 PM
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 - 14/May/13 07:53 PM
Assignee Joe Di Pol [ jfdipol ] Snjezana Sevo-Zenzerovic [ snjezana ]
Scott Oaks made changes - 15/May/13 08:50 PM
Status Open [ 1 ] Closed [ 6 ]
Resolution Duplicate [ 3 ]