Re: Bug fixed for null dirty fields on new records

anthony berglas <[email protected]> Mon, 22 Jul 2013 18:33:44 +1000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <CA+_PZMfJtofBWqCR8HXV1Hc-FhSkjtp-Ne1jZAnezRorZWOe6g@mail.gmail.com>
--047d7b2e4c46362b9604e2158b6a
Content-Type: text/plain; charset=ISO-8859-1

Thanks Franck, sounds good.

Anthony


On Mon, Jul 22, 2013 at 5:45 PM, Franck Routier <[email protected]>wrote:

>  Hi,
>
> I just commited a fix on the following corner case: when a non mandatory
> field was set to null on a new record, it was not detected as dirty.
>
> This was mostly harmless, except when the said field had a database level
> default value, as this default value was applied in this case, instead of
> null.
> Another side effect was for mass insert of the same record type, where
> adding an optional value on some records would break the batch updates
> into several batches, impacting performance, even if you cared to set the
> field to null otherwise.
>
> So this is now fixed, just beware if you were relying on the side effect
> of database default values being set anyway.
>
> Best regards,
>
> Franck
>
>


-- 

Dr Anthony Berglas, [email protected]       Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that that is the best way to collect firewood.

--047d7b2e4c46362b9604e2158b6a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable





<head>

<style type=3D"text/css">
<!--

/* start of attachment style */
       .ygrp-photo-title{
         clear: both;
         font-size: smaller;
         height: 15px;
         overflow: hidden;
         text-align: center;
         width: 75px;
       }
       div.ygrp-photo{
         background-position: center;
         background-repeat: no-repeat;
         background-color: white;
         border: 1px solid black;
         height: 62px;
         width: 62px;
       }

       div.photo-title=20
         a,
         div.photo-title a:active,
         div.photo-title a:hover,
         div.photo-title a:visited {
           text-decoration: none;=20
       }

       div.attach-table div.attach-row {
         clear: both;
       }

       div.attach-table div.attach-row div {
         float: left;
         /* margin: 2px;*/
       }

       p {
         clear: both;
         padding: 15px 0 3px 0;
	 overflow: hidden;
       }

       div.ygrp-file {
         width: 30px;
         valign: middle;
       }
       div.attach-table div.attach-row div div a {
         text-decoration: none;
       }

       div.attach-table div.attach-row div div span {
         font-weight: normal;
       }

       div.ygrp-file-title {
         font-weight: bold;
       }
 /* end of attachment style */
        -->
        </style>
        </head>
<html>
<head>
<style type=3D"text/css">
<!--
#ygrp-mkp {
  border: 1px solid #d8d8d8;
  font-family: Arial;
  margin: 10px 0;
  padding: 0 10px;
}

#ygrp-mkp hr {
  border: 1px solid #d8d8d8;
}

#ygrp-mkp #hd {
  color: #628c2a;
  font-size: 85%;
  font-weight: 700;
  line-height: 122%;
  margin: 10px 0;
}

#ygrp-mkp #ads {
  margin-bottom: 10px;
}

#ygrp-mkp .ad {
  padding: 0 0;
}

#ygrp-mkp .ad p {
  margin: 0;
}

#ygrp-mkp .ad a {
  color: #0000ff;
  text-decoration: none;
}
-->
</style>
</head>
<body>





<div dir=3D"ltr">Thanks Franck, sounds good.<div><br></div><div>Anthony</di=
v></div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Mo=
n, Jul 22, 2013 at 5:45 PM, Franck Routier <span dir=3D"ltr">&lt;<a href=3D=
"mailto:[email protected]" target=3D"_blank">[email protected]=
m</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
=20=20

=20=20=20=20
=20=20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <font size=3D"-1"><font face=3D"Arial">Hi,<br>
        <br>
        <font size=3D"-1">I just commited a fix on <font size=3D"-1">the
            following corner case:<font size=3D"-1"><font size=3D"-1"> </fo=
nt>when
              a<font size=3D"-1"> non mandatory field was set to null on a
                new record, it was not detected as dirty.<br>
                <br>
                <font size=3D"-1">This was mostly harmless, except <font si=
ze=3D"-1">when the said field had a <font size=3D"-1">database
                      level defau<font size=3D"-1">lt value, as this
                        default value was applied in this case, instead
                        of null.<br>
                        <font size=3D"-1">Another side effect was for mass
                          insert<font size=3D"-1"> of the same record
                            type, where adding an optional value on some
                            records would break </font></font>the batch
                        updates into several batches, impacting
                        performance, even if you cared to set <font size=3D=
"-1">the field to null otherwise.<br>
                          <br>
                          <font size=3D"-1">So this is now fixed<font size=
=3D"-1"><font size=3D"-1">, just <font size=3D"-1">b</font></font>eware if =
you
                              were relying on </font></font></font></font><=
/font></font></font></font></font></font></font></font>the side ef<font siz=
e=3D"-1">fect of <font size=3D"-1">database
                              default values being set anyway</font></font>=
.<br>
                          <br>
                          <font size=3D"-1">Best regards,<br>
                            <br>
                            <font size=3D"-1">Franck</font><br>
                          </font></font><br>
=20=20=20=20=20=20=20=20=20=20=20=20=20=20
  </div>

</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><p>
</p><p>Dr Anthony Berglas, <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>=A0=A0=A0=A0=A0=A0 Mobile: +61 4 4838 8874<=
br>
Just because it is possible to push twigs along the ground with ones nose<b=
r>
does not necessarily mean that that is the best way to collect firewood.</p=
>
</div>




<!-- |**|begin egp html banner|**| -->

<br>

=20=20=20=20
=20=20=20=20
<br>

<!-- |**|end egp html banner|**| -->


<div width=3D"1" style=3D"color: white; clear: both;"/>__._,_.___</div>

<!-- Start Recommendations -->
<!-- End Recommendations -->



<!-- |**|begin egp html banner|**| -->

  <img src=3D"http://geo.yahoo.com/serv?s=3D97476590/grpId=3D7360226/grpspI=
d=3D1705006905/msgId=3D2087/stime=3D1374482065" width=3D"1" height=3D"1"> <=
br>

<!-- |**|end egp html banner|**| -->

=20=20
<!-- |**|begin egp html banner|**| -->

<br>
      <div style=3D"font-family: verdana; font-size: 77%; border-top: 1px s=
olid #666; padding: 5px 0;" >
      Your email settings: Individual Email|Traditional <br>
      <a href=3D"http://groups.yahoo.com/group/SimpleORM/join;_ylc=3DX3oDMT=
JmM21hMGQzBF9TAzk3NDc2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlY=
wNmdHIEc2xrA3N0bmdzBHN0aW1lAzEzNzQ0ODIwNjU-">Change settings via the Web</a=
> (Yahoo! ID required) <br>
      Change settings via email: <a href=3D"mailto:SimpleORM-digest@yahoogr=
oups.com?subject=3DEmail Delivery: Digest">Switch delivery to Daily Digest<=
/a> | <a href =3D "mailto:[email protected]?subject=3D=
Change Delivery Format: Fully Featured">Switch to Fully Featured</a> <br>
           <a href=3D"http://groups.yahoo.com/group/SimpleORM;_ylc=3DX3oDMT=
JkcWtnN3ZmBF9TAzk3NDc2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlY=
wNmdHIEc2xrA2hwZgRzdGltZQMxMzc0NDgyMDY1">
        Visit Your Group=20
      </a> |
      <a href=3D"http://docs.yahoo.com/info/terms/">
        Yahoo! Groups Terms of Use
      </a> |
      <a href=3D"mailto:[email protected]?subject=3DUns=
ubscribe">
       Unsubscribe=20
      </a>=20
 <br>
    </div>
  <br>

<!-- |**|end egp html banner|**| -->


<div style=3D"color: white; clear: both;"/>__,_._,___</div>
</body>

</html>

--047d7b2e4c46362b9604e2158b6a--