Adam Hardy wrote:
If I put a flush() into the code after the JPA operation, it tries to
commit and throws an exception, but it also scrubs my entity from the
EntityManager and then my JSPs can't do any lazy loading to display the
data again (and give the user a second chance to enter correct data).
So what am I doing wrong? Have I mis-configured the Spring
TransactionManager somehow? Is there a JPA setting I should be using?
Should I be doing something completely different?
Maybe you should try to validate the data before you try to merge it in
the database. Most JSP framworks support validation, and it is also
integrated in JSF.
In other words, JSP/JSF should handle validation, not DB.
Regards,
Ognjen