Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-577

Change default allocationSize from 10 to 1

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA1
    • Fix Version/s: 2.0-BETA3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      I propose to change the default value of allocationSize for sequence columns from current 10 to 1. It's defined in $definition['allocationSize'] in Doctrine/ORM/Mapping/ClassMetaFactory.php.

      The improvement request is based on detailed discussion on http://www.doctrine-project.org/jira/browse/DDC-569?focusedCommentId=12855&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12855

      Current default value for allocationSize=10 is CONFUSING and I am sure it will cause problems and misunderstoods for many people in future.

      The core of the problem is that lot of people define table structure manually, separately from entity annotations. And while the default allocationSize is 10, they have to remember (and they have to know they should remember) each time they write new table and new entity, that:

      a) They have to define each the sequence in database manually with INCREMENT BY 10
      b) OR they have to define in each entity manually the annotation for @SequenceGenerator - allocationSize=1
      c) OR they have to manually use strategy="IDENTITY", but it's primarily related to primary keys, not to all sequences at general.

      Shortly, in an intuitive way everybody assumes the behaviour as allocationSize would be 1. Current default value 10 is not in accord with this intuitive perception and will cause many questions and misunderstoods.

      The "preloading" of 10 values at once is a kind of "advanced optimalization" - it's great it is available and implemented - but it should not be applied automatically, but only after explicit setup.

        Activity

        jantichy Jan Tichý created issue -
        romanb Roman S. Borschel made changes -
        Field Original Value New Value
        Fix Version/s 2.0-BETA1 [ 10030 ]
        romanb Roman S. Borschel made changes -
        Fix Version/s 2.0-BETA3 [ 10060 ]
        Hide
        romanb Roman S. Borschel added a comment -

        This should be changed for BETA3.

        Show
        romanb Roman S. Borschel added a comment - This should be changed for BETA3.
        Hide
        beberlei Benjamin Eberlei added a comment -

        Fixed and scheduled for 2.0 BETA 3

        Show
        beberlei Benjamin Eberlei added a comment - Fixed and scheduled for 2.0 BETA 3
        beberlei Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Roman S. Borschel [ romanb ] Benjamin Eberlei [ beberlei ]
        Resolution Fixed [ 1 ]
        Hide
        guilhermeblanco Guilherme Blanco added a comment -
        Show
        guilhermeblanco Guilherme Blanco added a comment - Actually patch was only committed now. http://github.com/doctrine/doctrine2/commit/5719f8523bbb3c8a6fd11c749e5317b238d3d2b3
        guilhermeblanco Guilherme Blanco made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira [ 11332 ] jira-feedback [ 15625 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15625 ] jira-feedback2 [ 17489 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17489 ] jira-feedback3 [ 19746 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={expand=changesets[0:20].revisions[0:29],reviews, query=DDC-577}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            beberlei Benjamin Eberlei
            Reporter:
            jantichy Jan Tichý
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: