Grails
  1. Grails
  2. GRAILS-8358

Regression: updates failing after domain class modified

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-RC2
    • Component/s: None
    • Labels:
      None
    • Environment:
      2.0.0.BUILD-SNAPSHOT

      Description

      I can't seem to update scaffolded domain classes after adding a new property while run-app is active. To reproduce:

      1. Grab the project from GRAILS-8344
      2. Start run-app
      3. Go to http://localhost:8080/where/book/list
      4. Edit Book.groovy, adding a String isbn property
      5. Refresh the list view until the new column is displayed.
      6. Click through to an existing book.
      7. Click on Edit
      8. Enter a value for the Isbn field
      9. Click Update

      I get this exception:

      Cannot set readonly property: properties for class: org.example.Book. Stacktrace follows:
      Message: Cannot set readonly property: properties for class: org.example.Book
         Line | Method
      ->>  74 | update  in org.example.BookController
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |   886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
      |   908 | run . . in     ''
      ^   680 | run     in java.lang.Thread
      

        Activity

        Hide
        Graeme Rocher added a comment -

        Can't reproduce this in head

        Show
        Graeme Rocher added a comment - Can't reproduce this in head
        Hide
        Peter Ledbrook added a comment -

        I can't even get the reloading working! Using 30de06cb8c03723b29cec0af34fd2d2916c29cf4

        Show
        Peter Ledbrook added a comment - I can't even get the reloading working! Using 30de06cb8c03723b29cec0af34fd2d2916c29cf4
        Hide
        Peter Ledbrook added a comment -

        This appears to have been fixed. Note that it seems you have to add a constraint of nullable: true for the new field for it to be reloaded properly with a dbCreate="update" value.

        Show
        Peter Ledbrook added a comment - This appears to have been fixed. Note that it seems you have to add a constraint of nullable: true for the new field for it to be reloaded properly with a dbCreate="update" value.

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Peter Ledbrook
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development