Transaction Management

Hibernate Transaction Management

Transaction simply represents a unit of work ,In such case, if one step fails, the whole transaction fails.

  • The methods of Transaction interface are as follows:
    * void begin() starts a new transaction.
    * void commit() ends the unit of work unless we are in FlushMode.NEVER.
    * void rollback() forces this transaction to rollback.
    * boolean wasCommited() checks if the transaction is commited successfully.
    * boolean wasRolledBack() checks if the transaction is rolledback successfully.

Example of Transaction Management in Hibernate

Transaction associated with Dao layer
spring-config.xml

--

--

--

Java||Spring-Boot|| Micro services Application developer|| INDIA

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

10 Things to do when conducting your Exploratory Data Analysis (EDA)

Coding is the 21st century’s Lego

The World Of CSS

Launching Wordpress using Amazon EC2,EFS,S3,CloudFront automated with Terraform

Concurrency: Foundational Knowledge of Multi-threaded Programming Languages!

FlutterForce — #Week 160

Learn HowTo Learn

Welcome to Couch Potato, a Chrome Extension to Watch Stuff with Friends

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sanjay Singh

Sanjay Singh

Java||Spring-Boot|| Micro services Application developer|| INDIA

More from Medium

Credit Checker: Access Equifax, Experian, and TransUnion credit reports from a single platform

CS371p Spring 2022 Week 4: Fazal Ali

GitHub — oneplus-x/Awesome-Hacking: A collection of awesome works and penetration testing resources.

WeStarter IWO(DAO) will goes live on January 19, 2022 at 6:00 UTC