Re: How to decrease the timeout in Jakarta EE 9.1 CDI Convesation Scope (MyFaces 3.0)

2022-09-01 Thread Krishan Gandhi
Unsubscribe
*Krishan Gandhi*
CTO,
KsquareTech


On Fri, Sep 2, 2022 at 10:37 AM Melvin Mak  wrote:

> Unsubscribe
>
> From: Thomas Andraschko
> Sent: Thursday, 1 September 2022 11:43 pm
> To: MyFaces Discussion
> Subject: Re: How to decrease the timeout in Jakarta EE 9.1 CDI Convesation
> Scope (MyFaces 3.0)
>
> Hi,
>
> Conversations are controlled by CDI/openwebbeans, so better ask there
>
> fernando cesar de lima  schrieb am Do., 1.
> Sept. 2022, 16:59:
>
> > 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(1) 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=1
> >
> >
> > 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(1);
> > 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
> >
> > Thanks you very much
> >
>
>


RE: How to decrease the timeout in Jakarta EE 9.1 CDI Convesation Scope (MyFaces 3.0)

2022-09-01 Thread Melvin Mak
Unsubscribe

From: Thomas Andraschko
Sent: Thursday, 1 September 2022 11:43 pm
To: MyFaces Discussion
Subject: Re: How to decrease the timeout in Jakarta EE 9.1 CDI Convesation 
Scope (MyFaces 3.0)

Hi,

Conversations are controlled by CDI/openwebbeans, so better ask there

fernando cesar de lima  schrieb am Do., 1.
Sept. 2022, 16:59:

> 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(1) 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=1
>
>
> 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(1);
> 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
>
> Thanks you very much
>



Re: How to decrease the timeout in Jakarta EE 9.1 CDI Convesation Scope (MyFaces 3.0)

2022-09-01 Thread fernando cesar de lima
Hi Thomas,

Thank you for your advice,



Em qui., 1 de set. de 2022 às 12:43, Thomas Andraschko <
andraschko.tho...@gmail.com> escreveu:

> Hi,
>
> Conversations are controlled by CDI/openwebbeans, so better ask there
>
> fernando cesar de lima  schrieb am Do., 1.
> Sept. 2022, 16:59:
>
> > 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(1) 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=1
> >
> >
> > 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(1);
> > 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
> >
> > Thanks you very much
> >
>


Re: How to decrease the timeout in Jakarta EE 9.1 CDI Convesation Scope (MyFaces 3.0)

2022-09-01 Thread Thomas Andraschko
Hi,

Conversations are controlled by CDI/openwebbeans, so better ask there

fernando cesar de lima  schrieb am Do., 1.
Sept. 2022, 16:59:

> 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(1) 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=1
>
>
> 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(1);
> 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
>
> Thanks you very much
>


How to decrease the timeout in Jakarta EE 9.1 CDI Convesation Scope (MyFaces 3.0)

2022-09-01 Thread fernando cesar de lima
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(1) 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=1


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(1);
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

Thanks you very much