{"id":3514,"date":"2025-10-05T00:00:00","date_gmt":"2025-10-04T22:00:00","guid":{"rendered":"https:\/\/tecnologia.euroinnova.com\/rollback\/"},"modified":"2026-08-05T11:09:54","modified_gmt":"2026-08-05T09:09:54","slug":"rollback","status":"publish","type":"post","link":"https:\/\/tecnologia.euroinnova.com\/en\/rollback","title":{"rendered":"Rollback"},"content":{"rendered":"<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">\u2018Rollback\u2019 is a term used in computing, particularly in the context of databases and transaction management systems, which refers to<strong> the process of rolling back a set of operations to a previous state.&nbsp;<\/strong>This is done to ensure the integrity and consistency of the data in the event of an error, failure or any other situation that requires operations to be rolled back.<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">If an error occurs during a transaction, a rollback allows all operations carried out up to that point to be reversed&nbsp;<strong>to correct this error and maintain the original consistency of the data.<\/strong><\/span><\/p>\n<h3 dir=\"ltr\" id=\"caracteristicas-del-rollback\"><span style=\"background-color:transparent;color:#000000;\">Rollback features<\/span><\/h3>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">Some key features of the rollback include:<\/span><\/p>\n<ul>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Atomicity<\/strong>: Rollback ensures that transactions are atomic; in other words, either all operations within a transaction are completed, or none of them are.<\/span><\/li>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Consistency<\/strong>: Ensures that the system returns to a consistent state following a failed transaction, thereby preventing data corruption.<\/span><\/li>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Insulation<\/strong>: The effects of a transaction are not visible to other transactions until the transaction is complete. If a rollback is performed, the changes made in that transaction will not be visible to other ongoing transactions.<\/span><\/li>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Durability<\/strong>: Although the rollback itself reverses the changes, the rollback process is designed to be durable, so that the changes are not applied and the system returns to a safe and consistent state.<\/span><\/li>\n<\/ul>\n<h2 dir=\"ltr\" id=\"aplicaciones-del-rollback\"><span style=\"background-color:transparent;color:#000000;\">Applications of rollback<\/span><\/h2>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">Rollback has the following applications:<\/span><\/p>\n<ul>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Financial system:<\/strong> A rollback is the mechanism that ensures a transaction is atomic. If an error occurs whilst a banking transaction is being carried out, a rollback allows us to reverse all the changes made up to that point.&nbsp;<\/span><\/li>\n<li dir=\"ltr\"><a href=\"https:\/\/tecnologia.euroinnova.com\/en\/database\/\"><span style=\"background-color:transparent;color:#000000;\"><strong>Databases<\/strong>: <\/span><\/a><span style=\"background-color:transparent;color:#000000;\">In relational database systems, a rollback is an essential operation for handling failed transactions. For example, if a transaction involving multiple insert, update or delete operations fails partway through, the system can revert all the operations carried out up to that point.<\/span><\/li>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Version control systems<\/strong>: In software development, version control systems such as Git allow you to perform rollbacks to revert changes and return the code to a previous state.<\/span><\/li>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Software update<\/strong>: When managing system and application updates, a rollback allows you to revert a failed update to a previous version that was working correctly.<\/span><\/li>\n<\/ul>\n<h2 dir=\"ltr\" id=\"ejemplo-de-sentencia-rollback-en-sql\"><span style=\"background-color:transparent;color:#000000;\">Example of a rollback statement in SQL<\/span><\/h2>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">Let\u2019s suppose we have a database with two simple tables: customers and transactions. We want to update a customer\u2019s balance and record a transaction. However, if something goes wrong during the process, we need to revert all the changes made.<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>Table structure<\/strong><\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">CREATE TABLE customers (<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;customer_id INT PRIMARY KEY,<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;name VARCHAR(100),<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;balance DECIMAL(10, 2)<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">);<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">CREATE TABLE transactions (<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;transaction_id INT PRIMARY KEY,<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;customer_id INT,<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;amount DECIMAL(10, 2),<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;date DATE<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">);<\/span><\/p>\n<ol>\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>We are starting the transaction<\/strong><\/span><\/li>\n<\/ol>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">BEGIN TRANSACTION;<\/span><\/p>\n<ol start=\"2\">\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>We carried out an operation<\/strong><\/span><\/li>\n<\/ol>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">\u2014 Let\u2019s suppose that the customer with ID 1 makes a deposit of 200<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">UPDATE customers<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">SET balance = balance + 200<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">WHERE customer_id = 1;<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">\u2014 We insert the transaction record<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">INSERT INTO transactions (transaction_id, customer_id, amount, date)<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">VALUES (1, 1, 200, GETDATE());<\/span><\/p>\n<ol start=\"3\">\n<li dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\"><strong>We make a mistake and perform a rollback<\/strong><\/span><\/li>\n<\/ol>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">IF @@ERROR != 0<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">BEGIN<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;\u2014 If an error occurs, we roll back all transactions<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;ROLLBACK TRANSACTION;<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;PRINT \u2018Transaction failed, changes reversed.\u2019;<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">END<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">ELSE<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">BEGIN<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;\u2014 If there are no errors, we will confirm the transaction<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;COMMIT TRANSACTION;<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">&nbsp;&nbsp;&nbsp;&nbsp;PRINT \u2018Transaction completed successfully.\u2019;<\/span><\/p>\n<p dir=\"ltr\"><span style=\"background-color:transparent;color:#000000;\">END<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>El rollback es un t\u00e9rmino utilizado en inform\u00e1tica, especialmente en el contexto de bases de datos y sistemas de gesti\u00f3n [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25],"tags":[],"class_list":["post-3514","post","type-post","status-publish","format-standard","hentry","category-metaterminos"],"acf":[],"_links":{"self":[{"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/posts\/3514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/comments?post=3514"}],"version-history":[{"count":0,"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/posts\/3514\/revisions"}],"wp:attachment":[{"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/media?parent=3514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/categories?post=3514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tecnologia.euroinnova.com\/en\/wp-json\/wp\/v2\/tags?post=3514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}