code: public void persist(Object e)
      {
          if (e == null)
          {
              throw new IllegalArgumentException(
                      "Entity object is invalid, operation failed. Please check previous log message for details");
          }
  
          // Create an object graph of the entity object.
          ObjectGraph graph = new GraphGenerator().generateGraph(e, this);
          // Call persist on each node in object graph.
          Node node = graph.getHeadNode();
          try
          {
              // Get write lock before writing object required for transaction.
              lock.writeLock().lock();
  
              node.setPersistenceDelegator(this);
              node.persist();
  
              // build flush stack.
              flushManager.buildFlushStack(node, com.impetus.kundera.persistence.context.EventLog.EventType.INSERT);
  
              // Flushing data.
              flush();
  
              // Add node to persistence context after successful flush.
              getPersistenceCache().getMainCache().addHeadNode(node);
          }
          finally
          {
              lock.writeLock().unlock();
          }
  
          // Unlocking object.
          graph.clear();
          graph = null;
          if (log.isDebugEnabled())
          {
              log.debug("Data persisted successfully for entity {}.", e.getClass());
          }
      }
docs: Writes an entity into Persistence cache. (Actual database write is done
  while flushing)