title: Spring JPA: created timestamp getting flushed after subsequent call to save function
body: <p>I have following class:</p>
  
  <pre><code>@Entity
  @Table(name = "payment")
  public class Payment {
  
     @Id
     private String transactionId;
  
     @CreationTimestamp
     private Timestamp createdTime;
  
     @UpdateTimestamp
     private Timestamp lastModifiedTime;
  
  }
  </code></pre>
  
  <p>I am extending JPARepository</p>
  
  <pre><code>public interface PaymentRepository extends JpaRepository&lt;Payment, Serializable&gt; {
  }
  </code></pre>
  
  <p>Inside my service class I am calling save function 2 times in following way:</p>
  
  <pre><code>paymentRepository.save(payment);
  /* Some statements (can be some modifications to payment object)*/
  paymentRepository,save(payment);
  </code></pre>
  
  <p>At the end I am finding value of createdTime as NULL in the database. In case second save statement is not executed in that case value of createdTime timestamp presents as expected.</p>
  
  <p>What can be done so that I will not lose created timestamp ?</p>