reset password
Author Message
ansuya
Posts: 8
Posted 00:16 May 21, 2009 |

 

Everything works fine when I add comment at first time.it dispalys fine on the page and insert into the database too.

when I add it again it gives me the following error

 

 

please help.

Attachments:
Last edited by ansuya at 00:21 May 21, 2009.
meera halani
Posts: 39
Posted 00:18 May 21, 2009 |

i guess some constraint is violating to add values. May be u r inserting duplicate value.Check it

yurimuradyan
Posts: 42
Posted 00:19 May 21, 2009 |

It is trying to create a duplicate entry, that's why it won't work. If you check the table those primary keys probably already exist. Make sure that id is left to hibernate to insert.

ansuya
Posts: 8
Posted 00:27 May 21, 2009 |

I let hibernet to add Id .I dont understnad which constraint violates.

meera halani
Posts: 39
Posted 00:38 May 21, 2009 |

i guess that blogid is inserted into comment id column. Check your database. Because it shows like comment id is added last.

cysun
Posts: 2935
Posted 08:33 May 21, 2009 |
ansuya wrote:

I let hibernet to add Id .I dont understnad which constraint violates.

It looks like you have a wrong unique contraint "comment_blog_entry_key". Since each blog entry can have multiple comments, blog_entry, which I assume is the foreign key in the comment table to blog entry id, should not be unique.

BTW, next time just upload the last part of the log file (i.e. the stack trace of the exception) instead of the whole thing. I don't want to download a 6M file just to read a few lines.

ansuya
Posts: 8
Posted 09:39 May 21, 2009 |

Thank you professor it works