You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by "Chris Geer (JIRA)" <ji...@apache.org> on 2012/11/06 03:18:11 UTC

[jira] [Commented] (RAVE-845) Cannot delete a user which has one or more friend associations

    [ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13491126#comment-13491126 ] 

Chris Geer commented on RAVE-845:
---------------------------------

I finally got some time to look into this and there is some good news and bad news...
 - Bad News: This same problem exists in 0.16, it's not new to 0.17 and model-split
 - Good News: If it wasn't caused by model-split the risk of have the same issue in lots of other places is more limited but we'll still test in another ticket.

I believe this is caused because there is a relationship from JpaPersonAssociation -> JpaPerson but not the other way. In User Service we should check for any associations and delete them. Right now there is no way in the repositories to delete all known associations, only loop through the existing friends and remove one-by-one.
                
> Cannot delete a user which has one or more friend associations
> --------------------------------------------------------------
>
>                 Key: RAVE-845
>                 URL: https://issues.apache.org/jira/browse/RAVE-845
>             Project: Rave
>          Issue Type: Bug
>    Affects Versions: 0.17
>            Reporter: Ate Douma
>            Priority: Blocker
>             Fix For: 0.18
>
>
> As reported  on the dev@ list:
>  
> On 11/05/2012 02:20 PM, Franklin, Matthew B. wrote:
> > I went through the release and everything looks good except that I can't
> > seem to delete users.  I get the following exception with the demo binary
> > as well as the built source:
> > 
> > [WARNING] [talledLocalContainer] SEVERE: Servlet.service() for servlet
> > dispatcher threw exception
> > [WARNING] [talledLocalContainer]
> > org.apache.rave.persistence.impl.TranslatedH2Exception: Unknown Database
> > Error
> > [WARNING] [talledLocalContainer] 	at
> > org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect.translateExceptionIfP
> > ossible(H2OpenJpaDialect.java:60)
> > [WARNING] [talledLocalContainer] 	at
> > org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionMa
> > nager.java:516)
> > [WARNING] [talledLocalContainer] 	at
> > org.springframework.transaction.support.AbstractPlatformTransactionManager.
> > processCommit(AbstractPlatformTransactionManager.java:754)
> > [WARNING] [talledLocalContainer] 	at
> > org.springframework.transaction.support.AbstractPlatformTransactionManager.
> > commit(AbstractPlatformTransactionManager.java:723)
> > 
> Followed up by:
> On 11/05/2012 04:47 PM, Franklin, Matthew B. wrote:
> > I confirmed that I was working with a clean database and dug a little
> > deeper to find that it only occurs when you are deleting a user that has
> > one or more associations.  The exact exception is as follows:
> > 
> > Referential integrity constraint violation: "CONSTRAINT_43:
> > PUBLIC.PERSON_ASSOCIATION FOREIGN KEY(FOLLOWEDBY_ID) REFERENCES
> > PUBLIC.PERSON(ENTITY_ID) (3)"; SQL statement:
> > DELETE FROM person WHERE entity_id = ? [23503-167] {prepstmnt 1230081703
> > DELETE FROM person WHERE entity_id = ? [params=?]} [code=23503,
> > state=23503]
> > 
> and:
> On 11/05/2012 04:57 PM, Chris Geer wrote:
> > Ok, this probably makes sense. Since we did the model split, I bet JPA no
> > longer enforces referential integrity. We probably need to add in business
> > level checks for related entities.
> and: 
> On 11/05/2012 05:09 PM, Ate Douma wrote:
> > Confirmed. I just tried this with a mysql database and hit the same error.
> > 
> > As Chris mentioned on his rely, most likely the referential integrity no longer 
> > is 'managed' through JPA after the model split. Which means this might not be 
> > the only case behavior is broken.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira