Database Conflicts and ZPsycopgDA

2 Messages Forum Options Options
Permalink
offmessage
Database Conflicts and ZPsycopgDA
Reply Threaded More
Print post
Permalink
Hello all

I'm hoping someone may be able to help me either diagnose a problem or
at least discount a potential candidate.

I have a Plone 2.5 site where, under certain circumstances, the
at_post_edit_script hook on one of my content types inserts into a
PostgreSQL database.

In 8 cases out of a total of 8,500 the insert never took place.  The
changes to the object were successfully saved (so processForm worked
fine) and there are no errors in the logs.  There are no exception
handlers wrapped around my code.  I know from experience that relational
database failures definitely get logged, and often break the site as well.

The only thing in my logs anywhere near the edit events are ZODB
Database Conflicts.  Could these be causing the ZPsycopgDA transaction
manager to roll back my PostgreSQL transaction, even though the changes
were successfully made to the content?

And if they are the cause, can anyone advise me at what level I should
be looking to trap them to avoid my data being chucked away?

I'm clutching at straws a bit here, but the code path is so simple and
the logs are so empty that unless the answer is "gremlins" I'm stumped.

All help, as always, very gratefully received.

Cheers

Andy
--
Isotoma, Open Source Software Consulting - http://www.isotoma.com
Tel: 01904 567349, Mobile: 07725 269250, Fax: 020 79006980
Postal Address: Tower House, Fishergate, York, YO10 4UA, UK

Registered in England.  Company No 5171172.  VAT GB843570325.
Registered Office: 3&4 Park Court, Riccall Road, Escrick, York, YO19 6ED

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users
Dieter Maurer
Re: Database Conflicts and ZPsycopgDA
Reply Threaded More
Print post
Permalink
Andy Theyers wrote at 2008-7-22 18:40 +0100:

> ...
>In 8 cases out of a total of 8,500 the insert never took place.  The
>changes to the object were successfully saved (so processForm worked
>fine) and there are no errors in the logs.  There are no exception
>handlers wrapped around my code.  I know from experience that relational
>database failures definitely get logged, and often break the site as well.
>
>The only thing in my logs anywhere near the edit events are ZODB
>Database Conflicts.  Could these be causing the ZPsycopgDA transaction
>manager to roll back my PostgreSQL transaction, even though the changes
>were successfully made to the content?

No.

Database ConflictErrors cause the transaction to be rolled back
(completely) and then the request is retried (completely).

Only in case of applicition logic which causes additional either
relational database local or Zope global transaction boundaries,
can such things happen.



--
Dieter

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users