0

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!

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.