Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
According to the doc the sesion's save() method can throw InvalidItemStateException exception.
It means that some item that was modified in current session also was modified from other thread and already saved. The transient space of the session cannot be saved
The quesion is what is a best practice in such case? Some code would be really appriciated. I cannot find any examples
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
Hi,
Whenever you are performing some critical task, lets say scheduler will update few things, same time there can be some common java methods running, I would suggest you can implement design patterns example Singleton design pattern can give good results with session as it will never allow multiple objects to execute and modify.
Somewhat it also depends upon what exactly is the requirement. When ever you makes some changes you can use session.save() in case when you know that another thread is roaming around.
Visualizações
respostas
Total de curtidas
Hi,
my advice would be to find out why two threads are trying to modify the same resource. There may be an issue with the way your code base has been written, only then should you decide how to implement a solution in code.
Is this for AEM5.x?
Regards,
Opkar
Hi,
Whenever you are performing some critical task, lets say scheduler will update few things, same time there can be some common java methods running, I would suggest you can implement design patterns example Singleton design pattern can give good results with session as it will never allow multiple objects to execute and modify.
Somewhat it also depends upon what exactly is the requirement. When ever you makes some changes you can use session.save() in case when you know that another thread is roaming around.
Visualizações
respostas
Total de curtidas
Hi,
if you get that exception, you can handle it programatically like this:
kind regards,
Jörg
Visualizações
Curtida
respostas