Re: [ZODB-Dev] Re: Understanding conflicts

2007-08-13 Thread Dieter Maurer
Jim Carroll wrote at 2007-8-12 16:45 +:
> ...
>Somehow, the code that adds the message to the persistent 
>list is running more than once.  I have read that ZEO will 
>re-run python code on a retry

You have read something wrong.

  The only thing, ZEO does in case of a conflict is trying to
  call "_p_resolveConflict" on the conflicting object.

Every redo is something the application may or may not do.



-- 
Dieter
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Re: Understanding conflicts

2007-08-12 Thread Jim Carroll
Dieter Maurer  handshake.de> writes:

> 
> Jim Carroll wrote at 2007-6-12 15:57 +:
> > ...
> >The code that's running essentially does:
> >
> >   add message to Persistent list in object
> >   get_transaction().commit()
> >   send_email()
> >
> >We are using Zodb 3.3a3, and ZEO 2.3a3.
> >
> >I've read that when a transaction retries, it re-runs 
code on the server side. 
> 
> The ZODB by itself does not rerun anything.
> Zope (its ZPublisher) retries a request up to three times when it
> fails due to a "ConflictError".
> 

I'm not using Zope.  I've got a quixote application that's 
using ZODB and ZEO.

Somehow, the code that adds the message to the persistent 
list is running more than once.  I have read that ZEO will 
re-run python code on a retry, and I think this is what's 
causing the duplicated data.

In my mind, what I need is some sort of assurance that the 
Persistent List is only being appened to once.  For some 
reason the commit() is causing it to be appended more than 
once when there's a conflict error.

How can I isolate my transactions so that a conflict aborts 
the current transaction before re-trying?

Thanks,
-Jim

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Re: Understanding conflicts

2007-06-23 Thread Dieter Maurer
Jim Carroll wrote at 2007-6-22 16:30 +:
> ...
>I'll be checking the quixote mailing list, but quixote isn't going to have
>anything zope-specific, and I do think that it's the interaction with zope
>that's giving me trouble...

The other sendmail packages are Zope products and can use some
Zope infrastructure. However, eventually, this Zope infrastructure
uses basic mechanisms of th ZODB only. Therefore, non Zope components
can use them as well.



-- 
Dieter
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Re: Understanding conflicts

2007-06-22 Thread Jim Carroll
Tres Seaver  palladion.com> writes:

> 
> The "stock" MailHost does have this problem.  There are a couple of
> alternatives which address it:
> 
> "zope.sendmail",
>   http://svn.zope.org/zope.sendmail/trunk/README.txt?rev=72633&view=auto
> 
> "MaildropHost",
>http://www.dataflake.org/software/maildrophost

Hi Tres,

These look very promising!  The readme files describe exactly what I'm seeing,
and the use of a transaction commit hook for the mail sounds appropriate.

These two packages seem like they're specific to Zope though... and I'm not 
using Zope.

I'm using quixote, my imports look like:

from quixote.sendmail import sendmail as qx_sendmail
from quixote.sendmail import RFC822Mailbox

I'll be checking the quixote mailing list, but quixote isn't going to have
anything zope-specific, and I do think that it's the interaction with zope
that's giving me trouble...

Am I wrong, do you think I can use the above packages with quixote?

-Jim



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Re: Understanding conflicts

2007-06-12 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jim Carroll wrote:
> Hi,  I've got a problem with a website where occasionally we send multiple
> e-mail messages when really we only want to send one.
> 
> The last time it happened, I noticed that there was a Conflict Error at the 
> same
> time as the e-mail send.
> 
> The code that's running essentially does:
> 
>add message to Persistent list in object
>get_transaction().commit()
>send_email()
> 
> We are using Zodb 3.3a3, and ZEO 2.3a3.
> 
> I've read that when a transaction retries, it re-runs code on the server 
> side. 
> How can I verify that that's what my setup would do? (my maillog on my server
> side doesn't show the duplicate e-mails, but I might not be looking far enough
> back in the logs.)

The "stock" MailHost does have this problem.  There are a couple of
alternatives which address it:

- - "zope.sendmail",
  http://svn.zope.org/zope.sendmail/trunk/README.txt?rev=72633&view=auto

- - "MaildropHost",
   http://www.dataflake.org/software/maildrophost


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGbtOz+gerLs4ltQ4RAo1mAJ48broeqxm9xlALdNZHJumkud7BJwCff6lX
rHzdVmAPa+3zfGr27SqDuYA=
=RQVQ
-END PGP SIGNATURE-

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev