title: JPA Commit issues with Oracle
body: <p>I am having issues with Oracle database. I am trying to update an entity and pass the updated entity to another method in the same transaction. This works using <code>mysql</code> database but doesn't work in <code>Oracle</code> database.</p>
  
  <p><strong>Entity Class</strong></p>
  
  <pre><code>public class EntityA
  {
      private Long id;
  
      @Version
      private Integer versionNo;
      //getters and setters
  }
  
  @Transactional //From Spring
  public class EntityService
  {
      @Inject
      @Named("myService")
      private MyService service;
  
      public void modify(final EntityA data)
      {
          EntityA entity = persistenceManager.merge(data);
          service.serializeEntity(entity);
      }
  }
  </code></pre>
  
  <p>So the problem is that, before <code>persistenceManager.merge(data);</code> is called, the <code>versionNo</code> field is still zero. After the call to <code>persistenceManager.merge(data);</code>, the value of <code>versionNo</code> field in the returned object i.e. <code>entity</code> is still zero. This object is then passed to <code>service.serializeEntity(entity);</code> which serialized the object with <code>versionNo</code> zero. But after the method i.e. <code>update</code> returns, the <code>versionNo</code> in the database changes to <code>1</code>. Is there a way of getting the uncommitted modified <code>EntityA</code> before passing it to <code>service.serializeEntity(entity);</code> because i need to serialize the modified object.</p>