[weld-issues] [JBoss JIRA] Updated: (CDITCK-80) Issue surrounding Bean.destroy() behavior
Pete Muir (JIRA)
jira-events at lists.jboss.org
Tue Dec 15 09:20:32 EST 2009
[ https://jira.jboss.org/jira/browse/CDITCK-80?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pete Muir updated CDITCK-80:
Fix Version/s: 1.1.0.CR1
> Issue surrounding Bean.destroy() behavior
> Key: CDITCK-80
> URL: https://jira.jboss.org/jira/browse/CDITCK-80
> Project: CDI TCK
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Tests
> Affects Versions: 1.0.0.GA
> Environment: jdk6 u15, glassfish v3
> Reporter: Vivek Pandey
> Fix For: 1.0.1.CR1, 1.1.0.CR1
> org.jboss.jsr299.tck.tests.implementation.simple.resource.persistenceContext.PersistenceContextDesctructionTest seems to be invalid or jsr299 7.3.6 needs to clarify. Read below:
> Sec 7.3.6 Lifecycle of resources of JSR299 layout this asseertion:
> "When the create() method of a Bean object that represents a resource is called, the container creates and returns a con- tainer-specific internal reference to the Java EE component environment resource, entity manager, entity manager factory, remote EJB instance or web service reference. This reference is not directly exposed to the application.
> Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying re- source, entity manager, entity manager factory, remote EJB instance or web service reference. This object must be passiva- tion capable.
> When the destroy() method is called, the container discards this internal reference and performs any cleanup required of state associated with the client or transaction."
> And there is this TCK test org.jboss.jsr299.tck.tests.implementation.simple.resource.persistenceContext.PersistenceContextDesctructionTest which does the following :
> CreationalContext<ManagedBean> creationalContext = getCurrentManager().createCreationalContext(managedBean);
> ManagedBean instance = managedBean.create(creationalContext);
> EntityManager em = instance.getPersistenceContext();
> assert em.isOpen();
> ==>managedBean.destroy(instance, creationalContext);
> assert !em.isOpen();
> When I looked in to the debugger I see that managedBean.destroy() call results in to calling GlassFish injected EntityManagerWarpper.close() which correctly throws InvalidStateException. This is as per JPA spec where EntityManager.close() is supposed to thro IllegalStateException for container manager EntityManager. See http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html#close().
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the weld-issues