Skip to content

Commit

Permalink
Reworded a misleading Doctrine explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Oct 19, 2014
1 parent 8dc90ef commit fef57d5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions book/doctrine.rst
Expand Up @@ -542,13 +542,12 @@ Take a look at the previous example in more detail:

.. note::

In fact, since Doctrine is aware of all your managed entities, when you
call the ``flush()`` method, it calculates an overall changeset and executes
the most efficient query/queries possible. For example, if you persist a
total of 100 ``Product`` objects and then subsequently call ``flush()``,
Doctrine will create a *single* prepared statement and re-use it for each
insert. This pattern is called *Unit of Work*, and it's used because it's
fast and efficient.
In fact, since Doctrine is aware of all your managed entities, when you call
the ``flush()`` method, it calculates an overall changeset and executes
the queries in the correct order. It utilizes cached prepare statement to
slightly improve the performance. For example, if you persist a total of 100
``Product`` objects and then subsequently call ``flush()``, Doctrine will
execute 100 ``INSERT`` queries using a single prepared statement object.

When creating or updating objects, the workflow is always the same. In the
next section, you'll see how Doctrine is smart enough to automatically issue
Expand Down

0 comments on commit fef57d5

Please sign in to comment.