Ondřej Chaloupka wrote:
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.
1 of 1 people found this helpful
A 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.
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:
<cache name="passivate" passivation-store-ref="filestore" aliases="SimpleStatefulCache"/>
<file-passivation-store name="filestore" idle-timeout="10"/>
or via jboss-cli.sh
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
For not not passivated cache try to annotate the stateful bean with:
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.
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.