Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Invoke @PreDestroy on ViewScoped ManagedBeans upon session expiration #905

Closed
glassfishrobot opened this issue Nov 2, 2010 · 14 comments
Closed

Comments

@glassfishrobot
Copy link

When session expiration occurs it would be nice if the @PreDestroy of ViewScoped
ManagedBeans gets invoked.

https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1839

Environment

Operating System: All
Platform: All

Affected Versions

[2.0]

@glassfishrobot
Copy link
Author

Reported by jack_van_ooststroom

@glassfishrobot
Copy link
Author

Issue-Links:
depends on
JAVASERVERFACES-2560
blocks
JAVASERVERFACES-2620
JAVASERVERFACES-2561

@glassfishrobot
Copy link
Author

@edburns said:
triage

@glassfishrobot
Copy link
Author

ssilvert said:
Hi Ed,

Do you think this will be fixed in 2.2? I'm seeing more complaints about it.

Stan

@glassfishrobot
Copy link
Author

@edburns said:
I can commit to making sure it works for the new javax.faces.flow.ViewScoped managed beans, which is based on CDI.

I will also investigate what it will take to make it work for the non-CDI based ones as well.

Thanks for bringing my attention to it.

@glassfishrobot
Copy link
Author

@edburns said:
testcase showing problem

@glassfishrobot
Copy link
Author

@edburns said:
This one is proving very tricky due to the many points in time and different scenarios where sessions can be invalidated. The fix for this must be very closely scrutinized, and, more importantly, must pass all the automated tests.

@glassfishrobot
Copy link
Author

@edburns said:
Mojarra changes.

@glassfishrobot
Copy link
Author

File: 20121026-0924-i_spec_905.patch
Attached By: @edburns

@glassfishrobot
Copy link
Author

File: 20121025-1757-i_spec_905-mods.zip
Attached By: @edburns

@glassfishrobot
Copy link
Author

ssilvert said:
We're also getting reports of memory leaks with view-scoped beans. I've verified the leak, but not traced its exact cause. I'm assuming that the leak is related to this issue.

Any opinion on that or insight into how the instances are referenced? I'm assuming that if view-scoped beans aren't eligible for GC when the session ends then they must be tied to application scope or to a ThreadLocal. Any other possibilities?

@glassfishrobot
Copy link
Author

@edburns said:
See JAVASERVERFACES-2561 for implementation.

@glassfishrobot
Copy link
Author

Marked as fixed on Friday, October 26th 2012, 8:15:56 am

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-905

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants