Hibernate implicit save in Seam application.
Issue
- Hibernate implicit save in Seam application.
We have an application on Jboss 5.1 using SEAM. When we want to update information in the database, here is how the code looks:
1. User is presented with update form via xhtml
2. User changes info and clicks Save button
3. Save button calls method in backing bean.
4. Backing bean method calls dao save.
5. Info gets persisted to db.
The trouble I am having is that, even if the backing bean method is empty (i.e. it does not call the save method in the Dao), the changes are still getting persisted to the database.
This implicit save,anytime an object is merely changed, is not desirable for us. We would like to explicitly call save to make db changes.
Example, we only want to call save after checking for certain validations. If the validations don't hold, we don't want to call a save, but to throw an error back to user. But because of the implicit save, our validations are getting overlooked.
Environment
- JBoss Enterprise Application Platform (EAP) 5.1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
