[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3562) update() should consult the dirty flag on the persistence context

Drew Kutchar (JIRA) jira-events at lists.jboss.org
Wed Oct 15 22:49:20 EDT 2008


    [ https://jira.jboss.org/jira/browse/JBSEAM-3562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12434009#action_12434009 ] 

Drew Kutchar commented on JBSEAM-3562:
--------------------------------------

I just tested this out using Hibernate as the JPA provider under GlassFish, even if you haven't changed anything on the form, once the form is submitted, the isDirty() returns true. I'm not sure how well Session.isDirty() works in Hibernate to make this actually effective.


> update() should consult the dirty flag on the persistence context
> -----------------------------------------------------------------
>
>                 Key: JBSEAM-3562
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3562
>             Project: Seam
>          Issue Type: Feature Request
>          Components: Framework
>    Affects Versions: 2.1.0.CR1
>            Reporter: Dan Allen
>            Assignee: Dan Allen
>            Priority: Minor
>             Fix For: 2.1.1.CR1
>
>   Original Estimate: 15 minutes
>  Remaining Estimate: 15 minutes
>
> When update() is called on a Home instance, only attempt to flush, register the status message, and raise the transaction success event if the persistence context was dirty. Of course, this only is effective if Hibernate is the persistence provider.
> @Transactional
> public String update()
> {
>    joinTransaction();
>    // For a non-Hibernate JPA provider, this always returns true
>    if (PersistenceProvider.instance().isDirty(getEntityManager()))
>    {
>       getEntityManager().flush();
>       updatedMessage();
>       raiseAfterTransactionSuccessEvent();
>       return "updated";
>    }
>    return "unchanged";
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list