You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Miroslav Nachev (JIRA)" <ji...@apache.org> on 2008/01/31 19:43:10 UTC

[jira] Created: (OPENJPA-506) PreRemove method callback is never called; PreUpdate is always called

PreRemove method callback is never called; PreUpdate is always called
---------------------------------------------------------------------

                 Key: OPENJPA-506
                 URL: https://issues.apache.org/jira/browse/OPENJPA-506
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 1.1.0
         Environment: Windows XP, JDK1.5, JDK6, PostgreSQL
            Reporter: Miroslav Nachev
             Fix For: 1.1.0


I am using EntityListeners to catch Insert, Update and Delete events. During my test case I notice that PreRemove method callback is never called. In the same time PreUpdate is always called whether  Delete (em.remove()) or Insert is called.

In my opinion Pre/Post Persist must be called on Insert operations. Pre/Post Update must be called on Update operations. Pre/Post Remove must be called on Delete operations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-506) PreRemove method callback is never called; PreUpdate is always called

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564551#action_12564551 ] 

Patrick Linskey commented on OPENJPA-506:
-----------------------------------------

Sure enough, things look a bit messed up (at least in 1.0.x). I've beefed up our existing test case, and have partially resolved the problem.

I believe that we should call Pre/PostUpdate for records that are persisted, flushed, and then modified. I do not believe that we should call Pre/PostUpdate for records that have been flushed, not modified, and then flushed again.

> PreRemove method callback is never called; PreUpdate is always called
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-506
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-506
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>         Environment: Windows XP, JDK1.5, JDK6, PostgreSQL
>            Reporter: Miroslav Nachev
>             Fix For: 1.1.0
>
>
> I am using EntityListeners to catch Insert, Update and Delete events. During my test case I notice that PreRemove method callback is never called. In the same time PreUpdate is always called whether  Delete (em.remove()) or Insert is called.
> In my opinion Pre/Post Persist must be called on Insert operations. Pre/Post Update must be called on Update operations. Pre/Post Remove must be called on Delete operations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-506) PreRemove method callback is never called; PreUpdate is always called

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564586#action_12564586 ] 

Patrick Linskey commented on OPENJPA-506:
-----------------------------------------

Resolved in 1.0.x; keeping open pending 1.1.0 resolution.

> PreRemove method callback is never called; PreUpdate is always called
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-506
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-506
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>         Environment: Windows XP, JDK1.5, JDK6, PostgreSQL
>            Reporter: Miroslav Nachev
>             Fix For: 1.1.0
>
>
> I am using EntityListeners to catch Insert, Update and Delete events. During my test case I notice that PreRemove method callback is never called. In the same time PreUpdate is always called whether  Delete (em.remove()) or Insert is called.
> In my opinion Pre/Post Persist must be called on Insert operations. Pre/Post Update must be called on Update operations. Pre/Post Remove must be called on Delete operations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-506) PreRemove method callback is never called; PreUpdate is always called

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey resolved OPENJPA-506.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.2

OpenJPA is now in line with the JPA spec's defined behavior. Additionally, new instances that are persisted and then flushed and then modified, and existing instances that are modified, flushed, and then modified again will receive Pre/PostUpdate callbacks for the subsequent modifications.

> PreRemove method callback is never called; PreUpdate is always called
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-506
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-506
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>         Environment: Windows XP, JDK1.5, JDK6, PostgreSQL
>            Reporter: Miroslav Nachev
>             Fix For: 1.0.2, 1.1.0
>
>
> I am using EntityListeners to catch Insert, Update and Delete events. During my test case I notice that PreRemove method callback is never called. In the same time PreUpdate is always called whether  Delete (em.remove()) or Insert is called.
> In my opinion Pre/Post Persist must be called on Insert operations. Pre/Post Update must be called on Update operations. Pre/Post Remove must be called on Delete operations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.