title: em.merge doesn't generate update statement
body: <p>I'm using JPA 2.0 and hibernate in the project and faced the problem:
  em.merge() doesn't generate the update statement. </p>
  
  <p>The detail situation is:
  I have an entity, which is successfully persisted. It has a foreign key on other entity, mapped like:</p>
  
  <pre><code>@ManyToOne(fetch = FetchType.LAZY, optional = false)
  @JoinColumn(name = "ENTITY2_ID", referencedColumnName = "ID")
  @ForeignKey(name = "FK_ENTITY2_PS")
  private Entity2 entity2;
  </code></pre>
  
  <p>It is created a bit later and persisted too. After that I make </p>
  
  <pre><code>entity1.setEntity2(entity2);
  em.merge(entity1); 
  </code></pre>
  
  <p>and see the log: hibernate doesn't generate the update statement for that and my application crashes with constraint violation. Is this a bug? Or am I doing something wrong?</p>
  
  <p><strong>UPD</strong>
  The logging is turned on and I see inserts there. 
  The method where <code>em.merge()</code> occurs is inside <code>@Stateless</code> bean, which methods have <code>TransactionalAttribute.REQUIRED</code> by default.</p>