T
Timasmith
It seems that if I have an object, say Person which a collection say
Cars that I can define a relationship between them and save a new
Person with Cars or extract a Person with Cars.
But when I pull a Person with Cats and then add a Car to the collection
I get an exception saving. Not in front of my workstation but it would
along the lines of an Object State Excepion and indicated that it
couldnt save due to the object being updated.
I only have one working thread so it from the sql output seems that
Hibernate executed two update statements and then failed on the second.
I wouldnt have thought it would have done any, one insert only
Maybe I am better pulling the sequence and saving the Car on its own
without touching the Person. I suppose that will work but defeats the
purpose of using Hibernate a bit. Not to mention if I have Car contain
Wheels I have to deal with them as well.
My cascade was save-update, might be related but setting it to All
didnt help.
Cars that I can define a relationship between them and save a new
Person with Cars or extract a Person with Cars.
But when I pull a Person with Cats and then add a Car to the collection
I get an exception saving. Not in front of my workstation but it would
along the lines of an Object State Excepion and indicated that it
couldnt save due to the object being updated.
I only have one working thread so it from the sql output seems that
Hibernate executed two update statements and then failed on the second.
I wouldnt have thought it would have done any, one insert only
Maybe I am better pulling the sequence and saving the Car on its own
without touching the Person. I suppose that will work but defeats the
purpose of using Hibernate a bit. Not to mention if I have Car contain
Wheels I have to deal with them as well.
My cascade was save-update, might be related but setting it to All
didnt help.