java amateur
I believe the problem here is that both ent and convencao are given the same contrato to manage using adiciona(contrato). Assuming this adds contrato to a collection of associated entities, check your cascade attributes on the associations. Does Entidade or Convencao own Contrato?now lets comment these two lines:
java amateur
java amateur
Yes, this is a standard many-to-many relationship. An Entidade can have Contratos with many Convencaos, and any Convencao can have Contratos with many Entidades.Originally posted by miguel lisboa:
imagine i'v a clinic and you have an insurance company; we both have to write down how much you'll pay for every type of surgery i'll realize: here you have Entidade (me), Contrato (what is written) and Convencao (you).
java amateur
You left Entidade.hbm.xml as delete-orphan, correct? This way, the Entidade owns the Contrato while Convencao merely references a Set of them. That seems reasonable to me.Originally posted by miguel lisboa:
i simply made, in Convencao.hbm.xml cascade default (deleted it)
I would recommend at this point to simplify your code to try to narrow the problem down. Yes, it happens when you close the session, but how much code can you remove and still cause the error when closing the session?
java amateur
java amateur
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|