Ticket #8631 (closed Bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Getting a relation can cause a write transaction

Reported by: regebro Owned by: regebro
Priority: minor Milestone: 3.3
Component: Unknown Keywords:
Cc:

Description

Getting information is not expected to cause write transactions, but when getting relations of an object that does not have an intid, an intid will be created for it. This will cause a write transaction.

Worse, if you try to get relations for an object that is not supposed to get pickled, it will get pickled anyway. And if that object is not picklable, you will get an error.

This can happen for example if you have a portlet getting a special type of relations to show them, and you then add a portlet. Portlets use Zope3 type add forms, so the context for the portlet will in that case be a view. It won't have an intid, so it will get one, and at the transaction commit the view will get pickled, which will fail.

The solution to this is to not register an object when you try to get it's intid, but only if you create a relation with an object that does not have an intid.

Change History

comment:1 Changed 3 years ago by regebro

  • Owner set to regebro
  • Status changed from new to assigned

comment:2 Changed 3 years ago by regebro

The problem basically is caused by this change: http://dev.plone.org/plone/changeset/17716

The question is what that is supposed to fix. We need to fix that some other way.

comment:3 Changed 3 years ago by regebro

  • Status changed from assigned to closed
  • Resolution set to fixed

OK, after conferring with alecm this has been reverted. This is to avoid getting an error when pre-existing content without an intid is assumed to have one. An upgrade step would be a better solution, alecm envisions one in five.intid.

comment:4 Changed 3 years ago by hannosch

  • Milestone changed from 3.x to 3.3
Note: See TracTickets for help on using tickets.