Hi all,
We use a UserType to map an oracle XMLTYPE column based on the implementation given in
http://www.hibernate.org/369.html.
In the UserType implementation, we have implemented the isMutable method to true and the accompaying methods : deepCopy, equals and hashcode correctly. Our goal is to detect modifications made to our object (that will be serialized in XML) and to update the XMLTYPE row only when it is necessary.
Actually, we are encountering a strange behaviour which is the following :
during the flush of one transaction, we see that Hibernate generates both an INSERT SQL and an UPDATE on our UserType.
We can not explain this behaviour because the one we expect is to have only one INSERT or one UPDATE per flush.
Does anyone has an explaination why we have both an INSERT and an UPDATE on one entity in one flush ?
We think, there is perhaps something related to the dirty checking algorithm on UserTypes. Does anyone can explain this alogrithm please ?
Thank you for your answers.
Nicolas
PS : The Hibernate version we use is 3.1.3.