I am create a update trigger in DB. When table A has been updated, it will insert the new value into table B. When my program update table A use hibernate session.update(), the trigger has triggered twice.I don't what happens? Please help me, thanks!
1 Answer
It is hard to say, because you do not share too much information. Maybe you should take a look to the SQL that was executed. Generated SQL can be shown via setting following property:
<property name="hibernate.show.sql" value="true"></property>
One possible reason is update of version column which can occur also when other data in row was not changed, but owned relationship changed.
It is not strictly specified in Hibernate documentation how many update statements are executed when something changes in entity, so there can be many other cases.