Investigating further the page is actually being posted twice. This was due to javascript and not the database, transactions, or otherwise. <br><br>
<div class="gmail_quote">On Tue, Dec 15, 2009 at 11:50 AM, Andreas Jung <span dir="ltr"><<a href="mailto:lists@zopyx.com">lists@zopyx.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>Please re-read my answer.<br><br>Andreas<br><br>schrieb Justin Dunsworth:<br>
<div>
<div></div>
<div class="h5">> This seems to be happening on more than just one query now... is<br>> there any suggestion on where to look?<br>><br>> On Thu, Dec 10, 2009 at 1:14 PM, Justin Dunsworth <<br>> <a href="mailto:justin.dunsworth@gmail.com">justin.dunsworth@gmail.com</a>> wrote:<br>
><br>>> Thanks for the reply... Are you suggesting that there may be an<br>>> issue with MySQL receiving the data from zope and the way it<br>>> handles it?<br>>><br>>> Strange thing is that I'm using the exact same method I have used<br>
>> thousands of times over and same code layout and this is the<br>>> first time I'm seeing it. I've changed around a few things<br>>> relating to variable names etc thinking it was the case but<br>
>> dumbing it down to the simplest way I can still is giving the<br>>> error.<br>>><br>>> On Thu, Dec 10, 2009 at 1:03 PM, Andreas Jung <<a href="mailto:lists@zopyx.com">lists@zopyx.com</a>><br>
>> wrote:<br>>><br>>>> In case of a ZODB conflict error the whole request will be<br>>>> repeat up to three times. If you database does not provide<br>>>> proper transaction support (trible check your MySQL<br>
>>> installation and your table type useage), you're doomed. A<br>>>> proper RDBMS like Oracle or Postgres will behave properly and<br>>>> abort the transaction in case of a ZODB transaction abort.<br>
>>><br>>>> -aj<br>>>><br>>>> Am 10.12.09 19:59, schrieb Justin Dunsworth:<br>>>>> I am running into a brand new issue today that I can't, for<br>>>>> the life of me, figure out. I wrote a standard page to insert<br>
>>>> data into a MySQL table using Z SQL methods from a form like<br>>>>> I always have but for some strange reason it's running the<br>>>>> same query twice, thus adding a duplicate entry.<br>
>>>><br>>>>> I have confined the original code in it's own document,<br>>>>> checked, double checked, and still no avail. Here's the code<br>>>>> for the page:<br>>>>><br>
>>>> <dtml-var frame_header> <dtml-if addnewstatus> <dtml-try><br>>>>> <dtml-call "RootSQLMethods.admin.Status_Add(_.None,_)"><br>>>>> <dtml-call "RESPONSE.redirect(BASE2+'/statuses')"><br>
>>>> <dtml-except> <p>Error while submitting! Status not<br>>>>> added.</p> <br>Error type: <dtml-var error_type> <br>Error<br>>>>> value: <dtml-var error_value> </dtml-try> </dtml-if> <form<br>
>>>> action="&dtml-URL;" method="post"> <table class="tborder"<br>>>>> align="center" width="30%" cellspacing="0" > <tr><td<br>
>>>> class="tcat" align="center" colspan="2" style="font-size:<br>>>>> 12pt;">Add New Status</td></tr> <tr><td width="35%"<br>
>>>> align="right"><b>Name:</b></td><td width="65%"><input<br>>>>> type="text" name="name_add" size=15></td></tr> <tr><td<br>
>>>> width="35%" align="right"<br>>>>> valign="top"><b>Description:</b></td><td<br>>>>> width="65%"><textarea name="description_add" cols=25<br>
>>>> rows=4></textarea></td></tr> <tr><td width="35%"<br>>>>> align="right"><b>Sort:</b></td><td width="65%"><input<br>
>>>> type="text" name="sort_add" value="5"<br>>>> size=1></td></tr><br>>>>> <tr><td align="center" colspan="2"><hr></td></tr> <tr><br>
>>>> <td><input type="hidden" name="addnewstatus" value="1"></td><br>>>>> <td> <button class="button" onclick="this.form.submit()">Add<br>
>>>> Status</button>&nbsp;&nbsp; <button class="button"<br>>>>> onclick="window.location = '<dtml-var BASE2>/statuses';<br>>>>> return false;">Cancel</button> </td> </tr> </table> </form><br>
>>>> <dtml-var frame_footer><br>>>>><br>>>>> I can run the SQL Method by itself and it works just fine<br>>>>> (only inserting it once) but when run as a separate page it<br>
>>>> adds the two.<br>>>>><br>>>>> Any assistance is appreciated<br>>>>><br>>>>><br>>>>> _______________________________________________ Zope maillist<br>
>>>> - <a href="mailto:Zope@zope.org">Zope@zope.org</a> <a href="https://mail.zope.org/mailman/listinfo/zope" target="_blank">https://mail.zope.org/mailman/listinfo/zope</a><br>>>>> ** No cross posts or HTML encoding! ** (Related lists -<br>
>>>> <a href="https://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">https://mail.zope.org/mailman/listinfo/zope-announce</a><br>>>>> <a href="https://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">https://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
>>>><br>>>><br>>>> -- ZOPYX Ltd. & Co KG \ zopyx group Charlottenstr.<br>>>> 37/1 \ The full-service network for your D-72070<br>>>> Tübingen \ Python, Zope and Plone projects<br>
>>> <a href="http://www.zopyx.com/" target="_blank">www.zopyx.com</a>, <a href="mailto:info@zopyx.com">info@zopyx.com</a> \ <a href="http://www.zopyxgroup.com/" target="_blank">www.zopyxgroup.com</a><br>>>> ------------------------------------------------------------------------<br>
>>><br>>>><br>E-Publishing, Python, Zope & Plone development, Consulting<br>>>><br>>>><br>>>><br>><br>><br></div></div>> ----------------------------------------------------------------------<br>
<div class="im">><br>><br>><br>_______________________________________________<br>> Zope maillist - <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>> <a href="https://mail.zope.org/mailman/listinfo/zope" target="_blank">https://mail.zope.org/mailman/listinfo/zope</a> ** No cross posts or<br>
> HTML encoding! ** (Related lists -<br>> <a href="https://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">https://mail.zope.org/mailman/listinfo/zope-announce</a><br>> <a href="https://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">https://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
<br><br>- --<br>ZOPYX Ltd. & Co KG \ zopyx group<br>Charlottenstr. 37/1 \ The full-service network for your<br>D-72070 Tübingen \ Python, Zope and Plone projects<br><a href="http://www.zopyx.com/" target="_blank">www.zopyx.com</a>, <a href="mailto:info@zopyx.com">info@zopyx.com</a> \ <a href="http://www.zopyxgroup.com/" target="_blank">www.zopyxgroup.com</a><br>
- ------------------------------------------------------------------------<br>E-Publishing, Python, Zope & Plone development, Consulting<br><br></div>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v1.4.10 (Darwin)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br><br>iEYEARECAAYFAksnzGMACgkQCJIWIbr9KYwPlACg1ddItBhsM1dT10Iq9pE/ULgE<br>RwkAoOfg9NdwZKdvx9DqSWfK91X1myTh<br>
=x0AL<br>-----END PGP SIGNATURE-----<br><br></blockquote></div><br>