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

Exploring Terraform through Heroku

Matrix Chain Multiplication :

Be careful when using Firebase Remote Config control for pre-announced feature

Features & Benefits of Amazon EC2 ?

The District Weekly — May 30th

Django API Part II

Create a Pre-Commit Git Hook for Eslint

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

Implementing AWS Security at scale — Deactivate dormant IAM users across all accounts

Ginkgo Gardens Redesign

How to manage a remote team

Synapse Storage Integration