You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a situation that I need to change the same entity several times in the context of one http request. I use hibernate panache and track updated entity using findById, change necessary fields (this entity is correctly persisted) but when the transactional method call ends and I get the same entity using 'get' method the entity remains the same, so, the transaction is not finished and all changes are not commited to database. When the same entity is changed for the second time and the request ends, only the changes that were made during the second change are commited correctly to the database.
Is it a correct behavior or am I missing how Transactional annotation actually works?
Is there a way to manually commit changes?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a situation that I need to change the same entity several times in the context of one http request. I use hibernate panache and track updated entity using findById, change necessary fields (this entity is correctly persisted) but when the transactional method call ends and I get the same entity using 'get' method the entity remains the same, so, the transaction is not finished and all changes are not commited to database. When the same entity is changed for the second time and the request ends, only the changes that were made during the second change are commited correctly to the database.
Is it a correct behavior or am I missing how Transactional annotation actually works?
Is there a way to manually commit changes?
Beta Was this translation helpful? Give feedback.
All reactions