You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by "Ate Douma (JIRA)" <ji...@apache.org> on 2012/11/05 22:38:12 UTC
[jira] [Created] (RAVE-845) Cannot delete a user which has one or
more friend associations
Ate Douma created RAVE-845:
------------------------------
Summary: 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:
--
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
[jira] [Updated] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Ate Douma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ate Douma updated RAVE-845:
---------------------------
Description:
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.
was:
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.
> 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
[jira] [Assigned] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Viknes B (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Viknes B reassigned RAVE-845:
-----------------------------
Assignee: Viknes B
> 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
> Assignee: Viknes B
> 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
[jira] [Commented] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Viknes B (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492548#comment-13492548 ]
Viknes B commented on RAVE-845:
-------------------------------
I spent some more time looking into this and I think we are in a position to use only queries to delete the associations.
The reason is
1) If we have a field called 'friends' in JpaPerson that maps to the items in JpaPersonAssociation, it would not make much sense when we do a person.getFriends() because whether a particular user is friend or not is defined by the status of the association and there is now way to specify it when we are joining tables using annotations.
And yet one more problem would be, when a friend relationship is established, we insert 2 rows into JpaPersonAssociation. One is from A to B and other is from B to A. Having a single field of JpaPerson associated to a column in JpaPersonAssociation would remove the A to B record but not the B to A one(which is again a problem).
2) Other thing that can be done is having 2 new fields called 'followerOf' and 'followedBy' in JpaPerson which would map to each of the columns in JpaPersonAssociation, and then when a person is deleted, the corresponding association would be deleted. But the downside is, we dont have the concept of followerof or followedby anywhere in Rave and this would just add more confusion.
So the only way that seems plausible to me is using a query to delete the associations when a user is deleted. If no one has any problem with it, i can go ahead and do it.
> 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
[jira] [Updated] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Viknes B (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Viknes B updated RAVE-845:
--------------------------
Attachment: Rave-845.patch
Attached patch. Checked on both H2 and MySQL DB by deleting john.doe user.
> 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
> Assignee: Viknes B
> Priority: Blocker
> Fix For: 0.18
>
> Attachments: Rave-845.patch
>
>
> 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
[jira] [Resolved] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Chris Geer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Geer resolved RAVE-845.
-----------------------------
Resolution: Fixed
Committed revision 1413830 - Thanks Viknes
> 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.18
> Reporter: Ate Douma
> Assignee: Viknes B
> Priority: Blocker
> Fix For: 0.18
>
> Attachments: Rave-845.patch
>
>
> 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
[jira] [Commented] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Chris Geer (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Viknes B (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13491184#comment-13491184 ]
Viknes B commented on RAVE-845:
-------------------------------
As a quick solution to this problem, I guess we could write the following query to find the associations of a particular user by username and delete all the JpaPersonAssociations while deleting a particular JpaPerson.
"select a from JpaPersonAssociation a where a.follower.username = :username or a.followedby.username = :username".
A long term solution would be to find a way to add a meaningful 2 way association between JpaPersonAssociation and JpaPerson and delete it through JPA cascade delete.
> 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
[jira] [Commented] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Chris Geer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492564#comment-13492564 ]
Chris Geer commented on RAVE-845:
---------------------------------
Sounds reasonable to me. I think this is better than the JPA relationship from Person unless we can get lazy loading working, otherwise it would require loading a lot of data.
> 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
[jira] [Updated] (RAVE-845) Cannot delete a user which has one or
more friend associations
Posted by "Ate Douma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/RAVE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ate Douma updated RAVE-845:
---------------------------
Description:
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.
was:
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:
> 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