I found the following information from the spec. But for me it is not clear who is not an English native.
Callback methods PostPersistand PostRemoveare called for the object after the object has been made permanent or deleted. These callbacks will also be called for all objects to which these operations are cascaded. The methods PostPersistand PostRemovewill be called after the operations of inserting and deleting the database, respectively. These database operations may occur immediately after the persist, merge, or remove operations were called, or they may occur immediately after the flush operation (which may be at the end of the transaction). The generated primary key values are available in the method PostPersist.
PostPersist
PostRemove
My question is: can any transactional jobs be dropped after @PostRemove?
@PostRemove
Let's say my entity deletes some offline files on @PostRemove
class MyEntity { @PostRemove private void onPostRemove() { // delete offline files related to this entity // not restorable! } }
, , ? (?)
, , , entites db . @PostRemove .
, , , , commit() . , , , , , . .
commit()
to_be_deleted db. . , commit() .
to_be_deleted
, Java EE, CDI jca. Spring, TransactionSynchronizationAdapter . .
TransactionSynchronizationAdapter
.
(EntityManager#flush()), . Post .
EntityManager#flush()
Post
Source: https://habr.com/ru/post/1648998/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1648993/python-threading-max-number-of-threads-to-run&usg=ALkJrhig9eCmQWUY_Jre5i39_ESfvEZ1XgHow to manage a workspace Jenkins begins to build? - jenkinsAndroid -Написанный фрагмент без головы - javaHttpListenerException "access denied" using GoogleWebAuthorizationBroker.AuthorizeAsync - c #How to get html form element with name - php variable - htmlHow to read millions of lines from a text file and quickly insert into a table - c #Does a Laravel rollback transaction support polymorphic relationships? - polymorphismRidge regression: Scikit-learn versus direct calculation does not match alpha> 0 - pythonMagento Product API - restError in brilliant knitting in RMarkdown. Error in appshot.shiny.appobj - shinyAll Articles