Bug #30934

persistAll() should only be called if EntityManager is still alive

Added by Thomas Hempel almost 4 years ago. Updated over 3 years ago.

Status:Resolved Start date:2011-10-14
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0.2
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.0

Description

In some cases it can happen, that the EntityManager is closed at the end of an controller. This can be a valid situation. See #30933 for more information.

It would be good if the persistAll() method is only called if the EntityManager is really functioning.


Related issues

related to TYPO3.Flow - Feature #30933: Check for unique constraints on add() Needs Feedback 2011-10-14

Associated revisions

Revision f8dd9311
Added by Karsten Dambekalns over 3 years ago

[BUGFIX] Only flush() the Doctrine ORM if it is open

In some cases it can happen, that the EntityManager is closed at the end
of a request This can be a valid situation (see #30933 for more).

This change makes persistAll() check if the EntityManager is open
before calling flush() on it.

Change-Id: I92f0fae135ceee30e675a706e67d58ba937802cc
Fixes: #30934
Releases: 1.0, 1.1

Revision 49111903
Added by Karsten Dambekalns over 3 years ago

[BUGFIX] Only flush() the Doctrine ORM if it is open

In some cases it can happen, that the EntityManager is closed at the end
of a request This can be a valid situation (see #30933 for more).

This change makes persistAll() check if the EntityManager is open
before calling flush() on it.

Change-Id: I529509b84032932cb3f4db1dad3cd8bcb37e5e89
Fixes: #30934
Releases: 1.0, 1.1

Revision 9a8bc9b1
Added by Karsten Dambekalns about 3 years ago

[TASK] Log skipped persistAll() due to closed EntityManager

To avoid exceptions we only flush the EM if it is still open. To be
able to spot errors more easily, this adds a log entry if the EM
was closed and flushing was skipped.

Change-Id: Iea4a446f9b3dffd8d3678fa9e1d82569de86697e
Related: #30934
Releases: 1.1, 1.2

Revision 660ee7e9
Added by Karsten Dambekalns about 3 years ago

[TASK] Log skipped persistAll() due to closed EntityManager

To avoid exceptions we only flush the EM if it is still open. To be
able to spot errors more easily, this adds a log entry if the EM
was closed and flushing was skipped.

Change-Id: Iea4a446f9b3dffd8d3678fa9e1d82569de86697e
Related: #30934
Releases: 1.1, 1.2

History

#1 Updated by Karsten Dambekalns almost 4 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns

#2 Updated by Karsten Dambekalns almost 4 years ago

  • Category set to Persistence

#3 Updated by Karsten Dambekalns almost 4 years ago

  • Affected Flow version set to FLOW3 1.0.0

#4 Updated by Karsten Dambekalns over 3 years ago

  • Target version set to 1.0.2
  • Has patch set to No

#5 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7316

#6 Updated by Karsten Dambekalns over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch FLOW3-1.0 has been pushed to the review server.
It is available at http://review.typo3.org/7319

#8 Updated by Karsten Dambekalns over 3 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF