Bug 817040 - HibernateRepository's save method does not returns persistent object with generated IDs in sportsclub example
HibernateRepository's save method does not returns persistent object with gen...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: Spring (Show other bugs)
2.0.0.ER4
Unspecified Unspecified
low Severity low
: ---
: 2.2.0
Assigned To: Rodney Russ
Tomas Repel
sportsclub
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-27 09:48 EDT by Tomas Repel
Modified: 2013-05-14 10:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-14 10:55:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Repel 2012-04-27 09:48:11 EDT
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 10:41:30 EDT
I believe this is due to the way in which identity generated ids are handled in 
Hibernate.
Comment 2 Karel Piwko 2012-06-04 07:49:04 EDT
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 16:08:35 EDT
Fixed
Comment 4 Marius Bogoevici 2012-06-08 03:02:28 EDT
fixed
Comment 6 Tomas Repel 2012-06-13 03:31:35 EDT
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 03:53:42 EDT
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 10:33:25 EDT
Bumped target version to 2.1.0.
Comment 9 mark yarborough 2012-11-05 09:44:17 EST
Per triage with mbg, kpiwko, mnovotny, move to WFK 2.2.
Comment 10 Tomas Repel 2013-02-04 11:01:11 EST
This issue is not reproducible anymore. It was fixed, see comment 7
Comment 11 Marek Novotny 2013-02-04 11:50:58 EST
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 04:02:55 EST
Verified in WFK 2.2.0.DR1.
Comment 14 Karel Piwko 2013-05-14 10:55:03 EDT
Closed as CURRENTRELEASE, part of WFK 2.2.0 distributables.

Note You need to log in before you can comment on or make changes to this bug.