-
1. Re: Stateless Bean with @PreDestroy-Annotation on WildFly 8 Final
sfcoy Feb 13, 2014 7:24 PM (in response to peterlustig)What is the lifecycle of your "RESTful-Webservice" implementation?
As you are using a stateless session bean, it's lifecycle is closely coupled with the object into which it is injected.
-
2. Re: Stateless Bean with @PreDestroy-Annotation on WildFly 8 Final
peterlustig Feb 14, 2014 4:39 AM (in response to sfcoy)Hello Stephen,
thank you for your answer. I know that the lifecycles are closely coupled together. But I don't think that the SLSB is destroyed because of the destruction of the RESTful-Webservice. The webservice is still there.
In addition: I noticed this behaviour only with Wildfly 8 Final, neither with JBoss AS 7.1.1 Final or Glassfish 4.
Thanks in advance and regards,
Peter
-
3. Re: Stateless Bean with @PreDestroy-Annotation on WildFly 8 Final
welle Feb 14, 2014 4:57 AM (in response to peterlustig)1 of 1 people found this helpfulIn WildFly 8.0.0.Final SLSB instance pooling is disabled by default This means that each call creates it's own instance that just lives for the duration of the call.
Try to enable pooling by the following CLI command:
/subsystem=ejb3:write-attribute(name=default-slsb-instance-pool,value=slsb-strict-max-pool)
-
4. Re: Stateless Bean with @PreDestroy-Annotation on WildFly 8 Final
peterlustig Feb 14, 2014 6:23 AM (in response to welle)Hello Anders,
thank you for your answer - I think that was the right hint. Now it works as I knew it from the other application server.
Now I wonder if I've used SLSB in the wrong way in the past...
Thank you very much for the helpful answer!
Regards
Peter
PS: Thanks to Stephen, too.