Bug 914738

Summary: EJB2 CMB beans: ejbActivate callback is called after the bean creation
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ondrej Chaloupka <ochaloup>
Component: EJBAssignee: wfink
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: dimitris, jmartisk, wfink
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-08 09:24:57 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:
Attachments:
Description Flags
Logs taken from the reproducer testcase none

Description Ondrej Chaloupka 2013-02-22 16:31:46 UTC
Called ejbActive after the create() call on home interface is incorrect by spec.

10.1.3
There are two possible transitions from the pooled to the ready state: through the ejbCreate<METHOD> and ejbPostCreate<METHOD> methods, or through the ejbActivate method. The container invokes the ejbCreate<METHOD> and ejbPostCreate<METHOD> methods when the instance is assigned to an entity object during entity object creation. 
The container invokes the ejbActivate method on an instance when an instance needs to be activated to service an invocation on an existing entity object—this occurs because there is no suitable instance in the ready state to service the client’s call or the ejbTimeout method.

This tescase should be testing the lifecycle callbacks' behaviour.
https://github.com/ochaloup/jboss-as/tree/entitybean-lifecycle-test

It tests the problem of postCreate and activate method. The create and postCreate method should be called in case of moving bean from pooled state to ready when the entity is created by home create method and business method is called. The postCreate should not be called before the business method is called. The activate callback should not be called in this case. The activate method should be called in case that entity bean with the id exists but the entity bean instance is in pool (e.g. after finder method is called).

Comment 1 Jaikiran Pai 2013-02-26 14:23:02 UTC
Can you please attach the logs of the failing test, so that I can quickly check if this is really an issue or a testcase problem?

Comment 4 Ondrej Chaloupka 2013-02-27 09:00:34 UTC
Created attachment 703305 [details]
Logs taken from the reproducer testcase

Comment 6 JBoss JIRA Server 2013-02-27 16:48:10 UTC
Wolf-Dieter Fink <wolfdieter.fink> updated the status of jira AS7-6635 to Coding In Progress

Comment 7 baranowb 2013-03-18 13:49:02 UTC
This issue should have different status.

Comment 8 JBoss JIRA Server 2013-03-28 19:51:22 UTC
Brian Stansberry <brian.stansberry> updated the status of jira AS7-6635 to Resolved

Comment 9 JBoss JIRA Server 2013-03-28 19:51:22 UTC
Brian Stansberry <brian.stansberry> made a comment on jira AS7-6635

Resolving as Won't Fix as CMP support has been removed from upstream AS. The linked bugzilla entry can track this for EAP.

Comment 10 Jan Martiska 2013-08-27 14:13:06 UTC
@Wolf, is this fixed (or planned to be fixed) in EAP?

Comment 11 Jan Martiska 2014-07-08 09:24:57 UTC
This has been fixed since 6.2.0 through commits 3689fb0, 475d984, f7fbc989. The provided tests pass. Closing.