Dónal
Dónal

Reputation: 187399

Hibernate transaction boundaries

I'm using Hibernate (in a Grails app) and the transactional boundaries are service methods, i.e. every time a service method is called a transaction starts, and every time a service call completes the transaction is either rolled back or committed.

If one of the database operations causes a database trigger to fire, and this trigger makes changes to persistent data, will these changes be rolled back or committed when the service call completes, or are changes made by the trigger "outside" the transaction?

Thanks, Don

Upvotes: 2

Views: 1909

Answers (1)

ChssPly76
ChssPly76

Reputation: 100806

Trigger changes are part of transaction and will be committed if transaction is committed and rolled back otherwise.

Upvotes: 4

Related Questions