<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8796</bug_id>
          
          <creation_ts>2015-12-11 18:06:41 +0000</creation_ts>
          <short_desc>Remove all manual transaction management</short_desc>
          <delta_ts>2016-03-01 13:53:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1 M3</target_milestone>
          
          <blocked>8895</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Wood">michael.g.wood</reporter>
          <assigned_to name="Michael Wood">michael.g.wood</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57222</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2015-12-11 18:06:41 +0000</bug_when>
    <thetext>Currently we have a lot of manual database transaction management code, after upgrading to Django 1.8 this seems to cause issues on MySQL. MySQL has a complicated way of dealing with transactions 

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=cb23e3043bf5c07f111787287a321df0ece647dd

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ee1af30548a6ac3f243c9ee61f0988aa307c0c6b

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e248a503ba84658dea086e65e9cde8b845b9c0ed

I don&apos;t think managing our own transactions was the right solution as we support multiple database backends which may have different versions and we may also have different versions of the database adapter, we should just avoid this entirely and leave Django to manage the transactions for us.

See also

https://docs.djangoproject.com/en/1.8/topics/db/transactions/

&quot;MySQL transaction peculiarities are outside the scope of this article, but the MySQL site has information on MySQL transactions.http://dev.mysql.com/doc/refman/5.6/en/sql-syntax-transactions.html &quot;

https://code.djangoproject.com/ticket/24921

&quot;
 The ORM assumes that Django has control of the database connection, including control of its transactional behavior.

The docs make it pretty clear that you&apos;re on your own in that case:

    Once you turn autocommit off, you get the default behavior of your database adapter, and Django won&apos;t help you.&quot;

So in summary manual transaction management is a can of worms we don&apos;t want to nor should open.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59080</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2016-02-16 10:11:04 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e0eb2ea48864b7b91a89d1b60c4fff6dddbe15e6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59581</commentid>
    <comment_count>2</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2016-03-01 13:53:32 +0000</bug_when>
    <thetext>Verified while checking bug 9116.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>