#014690: Duplicate Code on Save Handler Generator and Re-instantiation on each object

Description:

There is duplicate code on the creation of the Generators in both saveInternal and updateInternal functions of the save handler.

Additionally there are two bugs.

1. There is no exception if the generator class does not exist, producing a fatal error on the persistence check.
2. generators are re-instantiated for each saving of an object, producing considerable overhead.

A patch is attached, that moves the duplicate code into a private getIdGenerator() method which also fixes both bugs stated above.


Environment:

Operating System:
PHP Version: (please be specific, like '4.4.3' or '5.1.5')
Database and version:
Browser (and version):


- Attachments
ezcPoSaveUpdateInternalCodeDuplicationRemoval.diff (4.2 kb)
[Download] [Permanent Link]

- Comments

There is no attached patch, did you forget to add it?

#261020 by Derick Rethans on March 28th, 2009 [Permanent Link]

i missed a spot, saveOrUpdate retrieves the id generator also. A replacement with a call to getIdGenerator() would be possible at that position also.

#261021 by Benjamin Eberlei on March 28th, 2009 [Permanent Link]

Fixed in rev. #10226.

#261481 by Tobias Schlitt on May 6th, 2009 [Permanent Link]

- History
Properties
Type Bug
Priority Medium
Component Components » PersistentObject
Affects Unknown
Fix Versions 2008.2.3 - eZ components 2008.2.3
2009.1alpha1 - eZ components 2009.1alpha1
Reporter Benjamin Eberlei
Responsible Tobias Schlitt
Status 0 Closed
Resolution Fixed
Created March 28th, 2009
Updated May 6th, 2009
Resolved May 6th, 2009
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #015537
  Graph shows to small and truncated rotated axis labels