jafamo / spring-backbone-collection-databinding

A case study on collection data binding with Spring and Backbone
MIT License
1 stars 0 forks source link

JPAUsersDelete #1

Open jafamo opened 9 years ago

jafamo commented 9 years ago

Error deleting user repository, except the first. You need start the application and select JPA from panel. When you add users and save, if you want delete user2 or user3 and save, the application thows Exception, but if you delete the first user, you will not have problems. Example:

User1:user1@mail.com User2:user2@mail.com User3:user3@mail.com

If delete user2, error

Error: (identifier of an instance of org.examples.spring.databinding.jpa.User was altered from 2 to null; nested exception is org.hibernate.HibernateException: identifier of an instance of org.examples.spring.databinding.jpa.User was altered from 2 to null)

In the path: /src/test/java
This class "JPADataBindingController.test.java" has a function "public void itDeletesAUserAfterOne()". This function throws Exception because cannot delete users and save.

mefernandez commented 9 years ago

Hibernate exception when deleting a User

In JPA scenario, the server returns a 500 Internal Server Error when attempting to delete the 2nd User from a total of 3 users. The exception reads:

identifier of an instance of org.examples.spring.databinding.jpa.User was altered from 2 to null

Steps to get this error:

  1. Click JPA in the application menu. Here's a link to this screen running at Heroku
  2. Make sure there's 3 Users in the table. If it's empty, add 3 dummy Users and click "Save".
  3. Delete the 2nd User.
  4. Click "Save".