title: Possible race condition in this java code?
body: <pre><code>class Employee {
     transient Department = new Department();
  }   
  </code></pre>
  <pre><code>class Department {
     boolean isClosed;
  }
  </code></pre>
  <p>by default <code>isClosed</code> is false, some point in my logic its changed to <code>true</code> (<code>Department.isClosed = true</code>) but later in process its changed back to <code>false</code> ==&gt; No logic to explicitly change this.</p>
  <p>Based on my understanding, I suspect that this is happening due to Race Condition where different thread have modified this flag or one thread is not getting updated view of data.</p>
  <p>Is there anyway to prove this understanding? or possibly any other suspects?</p>
  <p>Please note, Its difficult(total 8-10 hours of retry and processing) to reproduce this issue as we face on production very rarely.</p>