-
1. Re: Timeout for passivation of stateful beans
jaikiran Jan 28, 2012 9:25 AM (in response to ochaloup)Ondřej Chaloupka wrote:
Hi,
I'm looking for possibility to define timeout for passivation stateful beans. Something similar what was possible in former version of JBoss by annotation @CacheConfig. I would like set timeout after which the server starts passivate beans and define maximal size of cache.
Those configurations will have to be done at the subsystem level where the cache is defined. In AS7 it's the infinispan subsystem where the cache is defined. So you'll have to configure it there.
-
2. Re: Timeout for passivation of stateful beans
jaikiran Jan 28, 2012 9:26 AM (in response to jaikiran)1 of 1 people found this helpfulA quick look at the jboss-as-infinispan_1_1.xsd shows that you might have to use the eviction element with a max-entries sub element for this.
-
3. Re: Timeout for passivation of stateful beans
ochaloup Jan 30, 2012 7:56 AM (in response to jaikiran)Thank you for showing me right way. It's described in documentation of Infinispan: https://docs.jboss.org/author/display/ISPN/Eviction
Inthe end I didn't use settings of infinispan because I didn't need any clustering options. I have used an attribute of file-passivation-store. It could be like this:
...
<caches>
<cache name="passivate" passivation-store-ref="filestore" aliases="SimpleStatefulCache"/>
</caches>
<passivation-stores>
<file-passivation-store name="filestore" idle-timeout="10"/>
</passivation-stores>
...
or via jboss-cli.sh
/subsystem=ejb3/file-passivation-store=filestore:write-attribute(name="idle-timeout", value="10")
-
4. Re: Timeout for passivation of stateful beans
rjanapala May 10, 2012 2:03 PM (in response to jaikiran)Hi,
I want to configure a Nonpasivated cache for a statefull session bean, the instance in the cache should not be expired(@StatefulTimeoushould be -1). Colud you please help how to configure this in JBOSS AS 7.1
-
5. Re: Timeout for passivation of stateful beans
ochaloup May 11, 2012 4:18 AM (in response to rjanapala)For not not passivated cache try to annotate the stateful bean with:
@Cache("simple")
This cache should be set in standalone-full.xml in subsystem ejb3. And it's defined as:
<cache name="simple" aliases="NoPassivationCache"/>
Try to check it.
-
6. Re: Timeout for passivation of stateful beans
rjanapala May 11, 2012 6:34 AM (in response to ochaloup)Hi Chaloupka,
Thanks for the reply,
Ya as you said i have tried this but the above configuration will only stop passivatin the statefull session bean, but how can stop removing the bean from cache after it get expired.