title: Is the class field in Spring @Service thread safe?
body: <pre><code>@Slf4j
  @Service
  public class SendServiceImpl implements SendService {
  
      private final MessageService messageService;
  
      private Message message;
  
      public SendServiceImpl (MessageService messageService) {
          this.messageService = messageService;
      }
  
      @Transactional
      @Override
      public void send(String messageGuid) {
              message = messageService.getOne(messageGuid);
              //...
      }
  </code></pre>
  
  <p>Is this class thread safe? what problems can there be if I run in 5 threads like this:</p>
  
  <pre><code>taskExecutor.execute(() -&gt; sendService .send(someGuid);//5 different guids
  </code></pre>
  
  <p>in practice, I studied the logs file and saw that with the same entity work different threads. Do I understand correctly that in this case, threads can change the value of entity <code>message</code>  if I declared message like class field?</p>
  
  <p>Can anyone explain this in detail?</p>