code: private void onSynchronization(Node node, EntityMetadata metadata)
      {
          DefaultTransactionResource resource = (DefaultTransactionResource) coordinator.getResource(metadata
                  .getPersistenceUnit());
          if (enableFlush)
          {
              resource.onFlush();
          }
          else
          {
              resource.syncNode(node);
          }
      }
docs: If transaction is in progress and user explicitly invokes em.flush()!
  
  @param node
  data node
  @param metadata
  entity metadata.