On Fri, Dec 5, 2008 at 15:17, dundeemt <[EMAIL PROTECTED]> wrote:
>
> If I call session.commit and nothing has been changed, does
> session.commit know that and just return, or does it create a larger
> performance impact?  i.e. If I'm looking to optimize, do I need to
> monitor if data is dirty and then call commit skipping the call if
> nothing is changed?
>
> I realize that calling the method has some impact, but if it is
> internally tracking if the session is dirty, it would be redundant for
> me to do it too and any performance gain would be negligible, is not a
> net loss.

I'm not sure. From a quick glance at the function code:
http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/lib/sqlalchemy/orm/session.py#L372
it seems like it's a "costly" operation. It will probably commit the
current transaction on the db even if it is empty. For a more definite
answer, you'd better ask on SA's list.

-- 
Gaƫtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to