Skip to main content

GF4 / SFSB @PrePassivate / @PostActivate get called on every bean invocation when Availability is enabled

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2006-08-22


I am trying to upgrade my software to GF4 and discovered this issue.
We have one HA-enabled @Stateful bean, which is marked HA in glassfish-ejb-jar.xmll



and Availability is enabled for the application.

We are seeing one serious and one minor issue.
The serious one is that @PrePassivate / @PostActivate method is getting called for every invocation.
As far as I know this is incorrect behavior. We have an interceptor there as well, but that should't affect things.

There is a glassfish JIRA issue for this:

Another, more minor problem is that when beans get passivated and then activated,
the transient fields don't get initialized. In Glassfish 3.1, they used to be initialized

private transient Set mySet = new HashSet<>();

when activated, mySet is null, and was correctly initialized under GF 3.1
I don't have JIRA issue for this because the spec isn't really clear on what it's actually supposed to do.

Can anybody reproduce this and verify that this indeed occur or schedule a fix?
This seems a pretty bad problem right now.