Dab tsi yog qhov sib txawv ntawm dej ntws thiab cog lus hauv hibernate?
Dab tsi yog qhov sib txawv ntawm dej ntws thiab cog lus hauv hibernate?

Video: Dab tsi yog qhov sib txawv ntawm dej ntws thiab cog lus hauv hibernate?

Video: Dab tsi yog qhov sib txawv ntawm dej ntws thiab cog lus hauv hibernate?
Video: Leng Yang - Yog Vim Dab Tsi (Official Full Song | Nkauj Tawm Tshiab) 2020/05/24 2024, Kaum ib hlis
Anonim

Tus yuam sij txawv yog tias thaum FlushMode teem rau COMMIT , cog lus () yaug qhov kev sib kho thiab kuj xaus chav tsev ntawm kev ua hauj lwm thiab koj tsis tuaj yeem rollback qhov kev hloov pauv qhov twg yaug () tsuas yog ib txwm sync ntawm qhov kev sib kho.

Ib yam li ntawd ib tug yuav nug, dab tsi yog cog lus nyob rau hauv hibernate?

cog lus yuav ua tus database cog lus . Cov kev hloov pauv rau cov khoom tsis tu ncua yuav raug sau rau hauv database. Thaum koj muaj ib yam khoom tsis tu ncua thiab koj hloov tus nqi ntawm nws, nws yuav qias neeg thiab hibernate yuav tsum tau yaug cov kev hloov pauv no rau koj cov txheej txheem persistence.

Qhov txawv ntawm saveAndFlush yog dab tsi? cawm tej zaum yuav lossis tsis sau koj cov kev hloov pauv rau DB tam sim ntawd. Thaum peb hu saveAndFlush qhov system tau tswj hwm qhov synchronization ntawm koj lub xeev qauv nrog DB. Nws tsis flush cov ntaub ntawv ncaj qha mus rau ib lub database kom txog rau thaum thiab tshwj tsis yog tias peb qhia meej hu ua flush thiab cog lus. Nws yog flush ncaj qha flush cov ntaub ntawv mus rau ib tug database.

Ntawm no, dab tsi flush ua nyob rau hauv hibernate?

Flushing cov kev sib tham rog Hibernate los synchronize lub cim xeeb hauv lub Session nrog cov ntaub ntawv (piv txwv li sau cov kev hloov pauv rau cov ntaub ntawv). Los ntawm lub neej ntawd, Hibernate yuav yaug hloov pauv rau koj: ua ntej qee cov lus nug executions. thaum muaj kev sib cog lus.

Txuag thiab yaug ua dab tsi?

Ib ' Txuag -ib- Flush ' yog ib lub hnab yas nqus dej uas, thaum poob rau hauv lub qhov dej tso quav, nthuav dav thiab siv qee qhov chaw uas yuav feem ntau yuav tsum tau ntim dej. Txhua lub sij hawm lub loo yog yaug nws txuag kwv yees li ib liter dej.

Pom zoo: