Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 817040

Summary: HibernateRepository's save method does not returns persistent object with generated IDs in sportsclub example
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Tomas Repel <trepel>
Component: SpringAssignee: Rodney Russ <rruss>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas Repel <trepel>
Severity: low Docs Contact:
Priority: low    
Version: 2.0.0.ER4CC: kpiwko, mnovotny
Target Milestone: ---   
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sportsclub
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-14 14:55:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas Repel 2012-04-27 13:48:11 UTC
Description of problem:

The Hibernate*Repository classes in sportsclub-hibernate-dao subproject don't work properly. When the save method is called with newly created object, it doesn't return the persistent object with generated ID included (the ID remains null). This has only very little impact on the functionality of the example from the user perspective. The only way for the user to hit this problem is when sending WS request for paymentNotification, the response won't contain the generated ID of payment.

Version-Release number of selected component (if applicable):

Sportsclub example, spring 3.1 variant, sportsclub 'hibernate' ear
WFK2 ER4
EAP6 ER5

How reproducible:

Always.

Steps to Reproduce:
1. build sportsclub example, spring 3.1 variant
2. deploy sportsclub-ear/target/sportsclub.ear (non-jpa ear)
3. use soapUI to send paymentNotification request
  
Actual results:

The returned response doesn't contain the return element with generated ID of newly created payment.

Expected results:

The response should contain the ID of payment.

Comment 1 Marius Bogoevici 2012-05-07 14:41:30 UTC
I believe this is due to the way in which identity generated ids are handled in 
Hibernate.

Comment 2 Karel Piwko 2012-06-04 11:49:04 UTC
I think this is caused by missing

org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener

registered in sessionFactory chain. 

If this is a spring 3.1 only issue, I guess it happens due to missing support for Merge in Hibernate4 support in Spring and application needs to be rewritten to handle merge in DAOs.

Comment 3 Marius Bogoevici 2012-06-07 20:08:35 UTC
Fixed

Comment 4 Marius Bogoevici 2012-06-08 07:02:28 UTC
fixed

Comment 6 Tomas Repel 2012-06-13 07:31:35 UTC
Still not fixed in WFK2 ER8. The link in previous comment has nothing to do with Sportsclub, it points to some fix in Petclinic example.

Comment 7 Marek Novotny 2012-06-13 07:53:42 UTC
my mistake, the fix is at http://git.app.eng.bos.redhat.com/?p=snowdrop/snowdrop-examples.git;a=commitdiff;h=eaaa3b0bae3704e997516f76f567240342f8f680;hp=2565c63c3a23c5faf806862fb899579b65881063, but I didn't rebuild sportsclub due my mistake and imagination it was in petclinic,

Comment 8 Karel Piwko 2012-09-24 14:33:25 UTC
Bumped target version to 2.1.0.

Comment 9 mark yarborough 2012-11-05 14:44:17 UTC
Per triage with mbg, kpiwko, mnovotny, move to WFK 2.2.

Comment 10 Tomas Repel 2013-02-04 16:01:11 UTC
This issue is not reproducible anymore. It was fixed, see comment 7

Comment 11 Marek Novotny 2013-02-04 16:50:58 UTC
Tomas, if the commit at http://git.app.eng.bos.redhat.com/?p=snowdrop/snowdrop-examples.git;a=commitdiff;h=eaaa3b0bae3704e997516f76f567240342f8f680;hp=2565c63c3a23c5faf806862fb899579b65881063 is what should have fixed that, it is in WFK 2.2.0.DR1. So I will change the status and you can verify it (I know you already did) - set correct status field value.

Comment 12 Tomas Repel 2013-02-05 09:02:55 UTC
Verified in WFK 2.2.0.DR1.

Comment 14 Karel Piwko 2013-05-14 14:55:03 UTC
Closed as CURRENTRELEASE, part of WFK 2.2.0 distributables.