hello, i have the following problem :
i have a tree, that lists my DB to my gui.
there arte categorys and contacts for example.
once i click on a button "new" when a category is selected in the tree, i can enter values for a new contact.
a new contact object is created and an ID generated for it ( i use Integer id's i generate by a sequence table )
then i say session.save(myContactToSave) and all is fine, it works.
but when i click on an existing contact - lets say with an id 1 - it shows me the selected contact in my form, fine.
after that i click on a category and again do the "new" button and create a new contact object.
the id generated for this new contact is 3 and i say session.save (myContactToSave) but this time i get an exception, saying identifier of an instance of Contact altered from 1 to 3.
iam confused, why it dont works when there was a existing contact selected before ?
somehow hibernate thinks i want to save the former selected contact with a new ID and values, but it is a new one......
help !!
thx
|