Results 1 to 6 of 6

Thread: Merge not happening, new item is added instead in the database

  1. #1
    Join Date
    Aug 2009
    Posts
    14

    Default Merge not happening, new item is added instead in the database

    Hi,

    I have created a Roo application using the reverse engineering feature and I am having the following problem:

    Object fails to get updated, instead I see a new record added in the database.

    I am using the following:
    • Spring Roo 1.1.5
    • DataNucleous since it uses JPA 1.0 that is needed to work on a Glassfish 2.1.1 server.
    • Spring MVC
    • Oracle database


    The only changes I done to the entities is to override the toString method and to specify a @SequenceGenerator. The controllers have not been changed at all.

    Did anybody experience a similar problem? Any theory on what could be wrong here?

  2. #2
    Join Date
    Aug 2009
    Posts
    14

    Default

    This issue is not reproducible with Eclipselink. But I can't use EclipseLink since it is a JPA 2.0 implementation.

  3. #3
    Join Date
    Aug 2009
    Posts
    14

    Default

    This seems to be a bug in Roo. This issue can be reproduced with the following commands:
    Code:
    project --topLevelPackage com.example.demo --projectName demo --java 6
    persistence setup --database HYPERSONIC_IN_MEMORY --provider DATANUCLEUS 
    entity --class ~.model.Car
    field string --fieldName name --notNull
    field date --type java.util.Date --fieldName createdDate 
    web mvc setup 
    focus --class ~.model.Car
    web mvc scaffold ~.web.CarController
    Steps to reproduce:
    1. Create new Roo project wtih the commands above
    2. Create new car
    3. Edit car and click on save
    4. Go to list view

    Notice that you will now have 2 cars instead of an edited car.

  4. #4
    Join Date
    Aug 2009
    Posts
    14

    Default

    This also happens with Roo 1.2M1

  5. #5
    Join Date
    Aug 2009
    Posts
    14

  6. #6

    Default

    I had the same problem. I was setting all fields except version, after setting that it was ok.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •