# Clearing Cache in Temporal

**URL:** <https://community.temporal.io/t/clearing-cache-in-temporal/3531>\
**Category:** Community Support\
**Tags:** java-sdk, general-impl\
**Created:** [December 6, 2021, 7:39am UTC](https://community.temporal.io/t/clearing-cache-in-temporal/3531 "2021-12-06T07:39:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faizan\_Kamal](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Faizan\_Kamal](https://community.temporal.io/u/Faizan_Kamal)\
**Post date:** [December 6, 2021, 7:39am UTC](https://community.temporal.io/t/clearing-cache-in-temporal/3531/1 "2021-12-06T07:39:26Z")

</div>

Hi,

I am using Temporal Java SDK. Sometime the logs added in Activity methods doesnt display in the console.

But when i see the Temporal UI, i see the activities got execute.

Can someone please help. Also i there a way to clear cache in Temporal server

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [December 6, 2021, 3:31pm UTC](https://community.temporal.io/t/clearing-cache-in-temporal/3531/2 "2021-12-06T15:31:23Z")

</div>

Hi @Faizan_Kamal, what SDK and version are you using? Were you able to debug to make sure that the logging code in your activities is executed when you say it’s not showing?

What do you mean with clear server cache? Do you mean in development env (Docker-compose)?

---

<div class="post-metadata">

**Author:** ![Faizan\_Kamal](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Faizan\_Kamal](https://community.temporal.io/u/Faizan_Kamal)\
**Post date:** [February 3, 2022, 11:54am UTC](https://community.temporal.io/t/clearing-cache-in-temporal/3531/3 "2022-02-03T11:54:14Z")

</div>

Hi,

I am using Java SDK 1.7.0

Issue which i am facing is for some activities, attempt number from Activity Execution context is coming as 2 though its getting executed for first time.

It should come as 1

Please let me know what can we do from our end.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 3, 2022, 1:35pm UTC](https://community.temporal.io/t/clearing-cache-in-temporal/3531/4 "2022-02-03T13:35:15Z")

</div>

Can you show your activity code where you are calling

`Activity.getExecutionContext().getInfo().getAttempt()`

(seeing the workflow history would help as well)

My initial guess would be that you are assigning it to a class variable maybe? Note that you are registering a single activity implementation with the worker which is reused so it would be best to call this method every time inside your activity method code.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 3, 2022, 3:04pm UTC](https://community.temporal.io/t/clearing-cache-in-temporal/3531/5 "2022-02-03T15:04:36Z")

</div>

Also note that workflow history does not show every activity retry attempt (to keep the history smaller in case you have a ton of retries), so let’s say that your activity retried 4 times and on the 4th attempt it succeeded, in history you will just see a single  
`ActivityTaskStarted` event with `attempt` property set to 4.  
This event also has a `lastFailure` property which will give you the failure of the last performed activity exec.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [February 3, 2022, 8:15pm UTC](https://community.temporal.io/t/clearing-cache-in-temporal/3531/6 "2022-02-03T20:15:40Z")

</div>

An activity task can be lost before starting execution. For example, if an activity worker or Temporal frontend crashes while it is being delivered. In this case, a task is retried and an attempt can be more than one on the first actual execution.
