Hi

Dont want to redirect you to tomee but owb properties are read from system
properties and application.properties (
https://tomee.apache.org/latest/docs/admin/configuration/application.html).

Also tomee uses the http session to store conversation beans so can be
another thing to tune if desired.



Le jeu. 1 sept. 2022 à 19:37, fernando cesar de lima <
[email protected]> a écrit :

> Hi, this is Fernando,
>
> I am using JSF 3.0 and Conversation Scope in some Managed Beans. The
> problem I am facing is to configure the timeout to expire abandoned
> conversations. The default 30 minutes is too long for my context and I need
> to set this around 10 minutes. I have tried to set the timeout using the
> conversation.setTimeout(10000) method, but, even having the TomEE showing
> that the correct timeout has been settled, through the
> conversation.getTimeout(), it keeps expiring the conversation, and
> consequently destroying the managed beans, only after 30 minutes.
>
> The second approach that I have tried is to create openwebbeans.properties
> file inside the META-INF/openwebbeans directory and putting these keys:
>
> configuration.ordinal=101
>
> org.apache.webbeans.conversation.Conversation.timeoutInterval=10000
>
>
> Again the results are the same. TomEE shows the correct timeout through
> the conversation.getTimeout() method, but keeps expiring the conversation
> only after 30 minutes.
>
>
> Following is the code that I have used to test the situation:
>
> package estudosjsf;
>
> import java.io.Serializable;
> import java.text.SimpleDateFormat;
> import java.util.Date;
>
> import jakarta.annotation.PostConstruct;
> import jakarta.annotation.PreDestroy;
> import jakarta.enterprise.context.Conversation;
> import jakarta.enterprise.context.ConversationScoped;
> import jakarta.inject.Inject;
> import jakarta.inject.Named;
>
> @Named
> @ConversationScoped
> public class Controller implements Serializable {
>
> private static final long serialVersionUID = 1L;
>
> private String text = "This is a simple text";
>
> @Inject
> private Conversation conversation;
>
> @PostConstruct
> public void create() {
> System.out.println("Created at " + new
> SimpleDateFormat("HH:mm:ss").format(new Date()));
> }
>
> @PreDestroy
> public void destroy() {
> System.out.println("Destroyed at " + new
> SimpleDateFormat("HH:mm:ss").format(new Date()));
> }
>
> public void begin() {
> conversation.begin();
> conversation.setTimeout(10000);
> System.out.println(conversation.getTimeout());
> }
>
> public void end() {
> conversation.end();
> }
>
> public String getText() {
> return text;
> }
>
> public void setText(String text) {
> this.text = text;
> }
>
> }
>
>
> I really appreciate any help
>
> Thank you very much
>

Reply via email to