Questions tagged [rollback]

A rollback is reverting data to a previous state. Typically questions in this tag involve transactions in Relational Database Management Systems, where a ROLLBACK command is used to discard any changes to the data since a transaction started.

1545 questions
19
votes
4 answers

How do I roll back a file checked in to Clearcase?

I have a file in my Clearcase repository. I checked it out and modified it, and then checked it back in. I haven't done anything like make a baseline, or rebase, or deliver in my stream/view. I regret having made the changes to this file--I should…
JXG
  • 7,263
  • 7
  • 32
  • 63
19
votes
5 answers

Spring data and mongodb - simple roll back with spring within @Transactional

I have 2 repositories, one for mongodb (DocumentRepository) and the other for hibernate entity (EntityRepository) I have a simple service: @Transactional public doSomePersisting() { try { this.entityRepository.save(entity); …
Urbanleg
  • 6,252
  • 16
  • 76
  • 139
18
votes
4 answers

How can I undo a changeset rollback in TFS 2010?

I accidentally rolled back an entire changeset. How can I undo that operation, and restore the changeset?
Eccentropy
  • 444
  • 1
  • 4
  • 11
18
votes
2 answers

How to roll back a transaction on error in PostgreSQL?

I'm writing a script for PostgreSQL and since I want it to be executed atomically, I'm wrapping it inside a transaction. I expected the script to look something like this: BEGIN -- 1) Execute some valid actions; -- 2) Execute some action that causes…
Marchyello
  • 621
  • 2
  • 7
  • 18
18
votes
3 answers

Rollback multiple commits (before Pushed to public) in Mercurial

I am aware that rollbacks can remove commits from the latest changeset in a local repository. However, is it possible to remove all the latest commits since the previous push without having to re-clone the share repository?
Karan
  • 14,824
  • 24
  • 91
  • 157
17
votes
2 answers

Stored Procedure Transaction

I have never used a Transaction, Commit and Rollback before and now I need to use one. I have checked around online, etc for examples to make sure that I am in fact using this correctly but I am still not sure if I have coded this correct. I am…
Taryn
  • 242,637
  • 56
  • 362
  • 405
17
votes
1 answer

How do you recover a rolled back change set in TFS?

In Visual Studio 2013 Update 3, I accidentally checked in a not-compiling, work-in-progress changeset that I intended to shelve in order for a co-worker to take. I rolled back the change set right away. Bad me. Is there a way to recover that…
Craig Celeste
  • 12,207
  • 10
  • 42
  • 49
16
votes
2 answers

Why does Mercurial only have one level of rollback?

I understand the restrictions of rollback and the care required in its use, but I just wondered why there is only one level of rollback. My guess it's a design decision and that the hassle of storing multiple previous transactional states to handle…
Nick Pierpoint
  • 17,641
  • 9
  • 46
  • 74
15
votes
5 answers

Rails: how to rollback a botched migration

I'm an idiot...screwed up a migration in Rails: thinking migrations would work like model generators (using references:modelname) I did the following: $ rails g migration add_event_to_photos references:event which created the migration class…
Meltemi
  • 37,979
  • 50
  • 195
  • 293
15
votes
3 answers

Transaction rollback and web services

Given an example of calling two web services methods from a session bean, what if an exception is thrown between the calls to two methods? In the case of not calling the web services the transaction will rollback and no harm done. However, the web…
Andreas Tasoulas
  • 453
  • 2
  • 8
  • 22
15
votes
2 answers

Rollback entire solution/project to specific changeset in TFS?

I am at changeset 121. I want to rollback down to version 112, ignoring all the changes I've made since then. I found this answer but I can't find the command in the menu. I'm struggling with this over an hour now and can't find the real solution.…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
14
votes
8 answers

Transaction rollback on Spring JDBC tests

I'm trying to get JDBC transaction rollback when using Spring-test without success. When I run the following the SQL update is always committed. package my.dao.impl; import org.junit.Test; import org.junit.runner.RunWith; import…
Synesso
  • 37,610
  • 35
  • 136
  • 207
14
votes
1 answer

How to let NHibernate retry deadlocked transactions when using session per request?

What pattern/architecture do you use in a 3-tiered application using NHibernate that needs to support retries on transaction failures, when you are using the Session-Per-Request pattern? (as ISession becomes invalid after an exception, even if this…
Henrik
  • 9,714
  • 5
  • 53
  • 87
14
votes
1 answer

What happens when rollback() fails for a transaction in MySQL?

try { Connection conn = ... MySQL connection ...; conn.setAutoCommit(false); // transaction starts .... do something .... } catch (MySQLException e) { try { conn.rollback(); } catch (Exception e) { // What…
SHH
  • 3,226
  • 1
  • 28
  • 41
14
votes
3 answers

How can I rollback a rails save/transaction?

In my controller I have some code like... ... if user.save something = Something.where("thing = ?", thing) if !(something.nil?) render json: { something: something } else #I WOULD LIKE TO ROLLBACK THE user.save HERE …
chris P
  • 6,359
  • 11
  • 40
  • 84