Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworded a misleading Doctrine explanation #4342

Merged
merged 2 commits into from
Nov 5, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepared statements

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