I think I currently have a problem of basic understanding what actually is ment to happen in what phase of the JSF Lifecycle when Seam is involved.
What I would expect is as follows:
When a ActionMethod is triggered through a commandlink, the JSF Lifecycle is started. Especially in UpdateModelValues the values from the html-form are transfered into the backing bean. Then afterwards in my actionMethod (called during invokeApplication phase), my application gets to decide wether the updatedModel is ment to be persisted or not.
So - that´s what I thought until about an hour ago, when I realized that something was "off" in my application. Turning on lifecycle-Debugging as well as hibernates "show_sql", I can find the following in my log:
[13:04:29] [tr1] [DEBUG] [...yfaces.lifecycle.LifecycleImpl:287 ] >> entering updateModelValues in org.apache.myfaces.lifecycle.LifecycleImpl Hibernate: update TimeRecordInput set total=? where id=? [13:04:29] [tr1] [DEBUG] [...yfaces.lifecycle.LifecycleImpl:314 ] >> exiting updateModelValues in org.apache.myfaces.lifecycle.LifecycleImpl
All depends upon how you are managing transactions. Results (usually) get flushed when transactions commit. If you use Seam transaction management (ie. SeamExtendedManagedPersistencePhaseListener) this happens at the end of the invoke application phase. If you use EJB3, it happens when session bean methods are called.