[Zope] SQL Method running twice

Justin Dunsworth justin.dunsworth at gmail.com
Tue Dec 15 12:34:26 EST 2009


This seems to be happening on more than just one query now... is there any
suggestion on where to look?

On Thu, Dec 10, 2009 at 1:14 PM, Justin Dunsworth <
justin.dunsworth at gmail.com> wrote:

> Thanks for the reply... Are you suggesting that there may be an issue with
> MySQL receiving the data from zope and the way it handles it?
>
> Strange thing is that I'm using the exact same method I have used thousands
> of times over and same code layout and this is the first time I'm seeing it.
> I've changed around a few things relating to variable names etc thinking it
> was the case but dumbing it down to the simplest way I can still is giving
> the error.
>
>  On Thu, Dec 10, 2009 at 1:03 PM, Andreas Jung <lists at zopyx.com> wrote:
>
>> In case of a ZODB conflict error the whole request will be repeat up to
>> three times.
>> If you database does not provide proper transaction support (trible
>> check your MySQL
>> installation and your table type useage), you're doomed. A proper RDBMS
>> like Oracle
>> or Postgres will behave properly and abort the transaction in case of a
>> ZODB transaction
>> abort.
>>
>> -aj
>>
>> Am 10.12.09 19:59, schrieb Justin Dunsworth:
>>  > I am running into a brand new issue today that I can't, for the life
>> > of me, figure out. I wrote a standard page to insert data into a MySQL
>> > table using Z SQL methods from a form like I always have but for some
>> > strange reason it's running the same query twice, thus adding a
>> > duplicate entry.
>> >
>> > I have confined the original code in it's own document, checked,
>> > double checked, and still no avail. Here's the code for the page:
>> >
>> > <dtml-var frame_header>
>> > <dtml-if addnewstatus>
>> >   <dtml-try>
>> >     <dtml-call "RootSQLMethods.admin.Status_Add(_.None,_)">
>> >     <dtml-call "RESPONSE.redirect(BASE2+'/statuses')">
>> >   <dtml-except>
>> >     <p>Error while submitting! Status not added.</p>
>> >     <br>Error type: <dtml-var error_type>
>> >     <br>Error value: <dtml-var error_value>
>> >   </dtml-try>
>> > </dtml-if>
>> > <form action="&dtml-URL;" method="post">
>> >   <table class="tborder" align="center" width="30%" cellspacing="0" >
>> >     <tr><td class="tcat" align="center" colspan="2" style="font-size:
>> > 12pt;">Add New Status</td></tr>
>> >     <tr><td width="35%" align="right"><b>Name:</b></td><td
>> > width="65%"><input type="text" name="name_add" size=15></td></tr>
>> >     <tr><td width="35%" align="right"
>> > valign="top"><b>Description:</b></td><td width="65%"><textarea
>> > name="description_add" cols=25 rows=4></textarea></td></tr>
>> >     <tr><td width="35%" align="right"><b>Sort:</b></td><td
>> > width="65%"><input type="text" name="sort_add" value="5"
>> size=1></td></tr>
>> >     <tr><td align="center" colspan="2"><hr></td></tr>
>> >     <tr>
>> >       <td><input type="hidden" name="addnewstatus" value="1"></td>
>> >       <td>
>> >         <button class="button" onclick="this.form.submit()">Add
>> > Status</button>&nbsp;&nbsp;
>> >         <button class="button" onclick="window.location = '<dtml-var
>> > BASE2>/statuses'; return false;">Cancel</button>
>> >       </td>
>> >     </tr>
>> >   </table>
>> > </form>
>> > <dtml-var frame_footer>
>> >
>> > I can run the SQL Method by itself and it works just fine (only
>> > inserting it once) but when run as a separate page it adds the two.
>> >
>> > Any assistance is appreciated
>> >
>> >
>> > _______________________________________________
>> > Zope maillist  -  Zope at zope.org
>> > https://mail.zope.org/mailman/listinfo/zope
>> > **   No cross posts or HTML encoding!  **
>> > (Related lists -
>> >  https://mail.zope.org/mailman/listinfo/zope-announce
>> >  https://mail.zope.org/mailman/listinfo/zope-dev )
>> >
>>
>>
>> --
>> ZOPYX Ltd. & Co KG          \  zopyx group
>> Charlottenstr. 37/1          \  The full-service network for your
>> D-72070 Tübingen              \  Python, Zope and Plone projects
>> www.zopyx.com, info at zopyx.com  \  www.zopyxgroup.com
>> ------------------------------------------------------------------------
>> E-Publishing, Python, Zope & Plone development, Consulting
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20091215/6e7a9576/attachment.html 


More information about the Zope mailing list