Issue Details (XML | Word | Printable)

Key: APF-935
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Matt Raible
Reporter: Christophe Thi?baud
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AppFuse

DB exception not well handled when updating existing user with using lazyLoadingFilter active

Created: 11/Oct/07 08:55 AM   Updated: 13/Nov/09 06:37 PM
Component/s: Service Layer
Affects Version/s: 2.0 Final
Fix Version/s: 2.1.0-M2

Environment: Windows XP, tomcat 6, hibernate, MySQL 5.04


 Description  « Hide
after enabling lazyLoadingFilter, when *updating* an user (e.g. 'admin') with some value rejected by the DB (e.g. change 'admin' Username to already existing 'user' Username : the unique key on app_user.username fires an exception), the DB raw exception is displayed to the user instead of begin trapped.

When *creating* a new user, the exception is correctly handled.

seems that the entityManager.flush() is not raising the exception when updating e record + lazy loading enabled.

NB. the behaviour is exactly the same when using JPA instead of hibernate

how to reproduce
-> mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0 -DgroupId=a.group.id -DartifactId=test
-> cd test
-> change web/src/.../web.xml to enable lazyLoadingFilter as documented into web.xml
-> launch app under tomcat
-> edit user 'admin'
-> change Username to 'user'