reset password
Author Message
manthan70
Posts: 7
Posted 09:50 May 20, 2009 |

Am not able to insert new entry in comments table. and existing entries are being overwritten if i try to add comment for some blogentry for which i already have some coments.

ERROR AbstractFlushingEventListener: Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

Attachments:
cysun
Posts: 2935
Posted 13:52 May 20, 2009 |

The log file is not very helpful.

My guess is that you assigned the id of an existing Comment object to a new Comment object, which caused the problem. Note that the id of a new Comment object should be NULL - Hibernte will generate the id for you.

manthan70
Posts: 7
Posted 14:32 May 20, 2009 |

ya it was same kind of problem. i just changed the generator in hbm file to 'increment' from 'native'. and its working all fine. thank you.