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
10
votes
3 answers

Visual Studio Database Project Rollback Script

I'm using the Database project in visual studio 2010 to generate a script to deploy my database (and it's changes). This works great. Is there a way to have Visual Studio database project generate a rollback script as well as the deployment…
QuinnG
  • 6,346
  • 2
  • 39
  • 47
10
votes
3 answers

How to rollback transactions when doing functional testing with Symfony2

I'm trying to write a functional test for my project in Symfony2. I'd like to test if a user can access a page, fill up a form and submit it. I'm trying to find a way to rollback the database to the state it was before the test. I found a helper…
Etienne
  • 159
  • 1
  • 2
  • 11
10
votes
2 answers

SQL Server alter database with rollback immediate

Sometimes when (for example) setting a database offline by executing the following command, an exception will be thrown, because one or more clients is connected: ALTER DATABASE SET OFFLINE According to this answer one solution is to use…
Jim Aho
  • 9,932
  • 15
  • 56
  • 87
10
votes
1 answer

Rollback for bulk copy

I have an application that make a copy from my database by bulk copy class in c#. Can I rollback the bulk copy action in sql server when occur an exception?
masoud ramezani
  • 22,228
  • 29
  • 98
  • 151
10
votes
2 answers

Is Rollback automatic in a "Using" scope with C# SQL Server calls?

When you create 'using' blocks for your SQL Connection, Transaction, and Command, it is well known that the connection, transaction, or command that the using block is associated with is disposed on its own properly after you leave the using block.…
Chris
  • 968
  • 16
  • 27
10
votes
1 answer

Cloning a previous version on Heroku

I'm new to Heroku. After pushing bad code to the server, I used heroku rollback to revert to a previous version. I then tried to clone this rollback to my computer with: git clone git@heroku.com:.git Unfortunately, this clones the…
nullnullnull
  • 8,039
  • 12
  • 55
  • 107
10
votes
2 answers

duplicate key error does not cancel/rollback mysql transaction

When in a mysql innodb transaction, I would expect a duplicate key error to cause a rollback. It doesn't, instead it simply throws an error and continues on to the next command. Once the COMMIT command is reached, the transaction will be committed,…
allixsenos
  • 383
  • 2
  • 19
10
votes
2 answers

JDBC: Does call to rollback() method have effect only if call to commit() method does not succeed?

I am new to Java JDBC, and developed a small database application. I am learning from O'Reilly - Database Programming with JDBC and Java 2nd Edition. Does con.rollback() have effect only ifcon.commit does not succeed? I expected that calling…
Saleh Feek
  • 2,048
  • 8
  • 34
  • 56
10
votes
1 answer

How to rollback without transaction

I made a huge mistake, I executed this query: update Contact set ContaPassword = '7FD736A3070CB9766' I forgot the WHERE clause, so this way it updated the password for all users. :( Is there a way I can recover the data before this query?
kbaccouche
  • 4,575
  • 11
  • 43
  • 65
10
votes
1 answer

Right way to discard changes in Git

I've seen many different approaches for discarding changes / reverting to a previous commit using Git. I usually can figure out which works for my situation, but in the process I've gotten quite confused by the different approaches. Most recently I…
Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
10
votes
1 answer

Rollback Inserts/Updates/Deletes in linq pad?

I found this article about how to insert, update and delete using linq pad but it mentions nothing about rolling back anything. Is it possible to rollback in linqpad?
chobo2
  • 83,322
  • 195
  • 530
  • 832
10
votes
4 answers

Easy transactions using Spring JDBC?

I am working on a Java app that uses Spring IoC and JDBC Template classes. I have a DAO class that has 4 methods : m1() to m4(). m1 performs multiple inserts and updates on table t1, m2 on table t2, m3 on t3, etc. The DAO methods are used as…
letronje
  • 9,002
  • 9
  • 45
  • 53
9
votes
3 answers

How to use SET XACT_ABORT ON the right way

We have recently been parachuted to a new ETL project with very bad code. I have in my hands a query with 700 rows and all sort of update. I would like to debug it with SET XACT_ABORT ON; and the goal is to rollback everything if only one…
Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113
9
votes
2 answers

JMS rollback

I have a process which involves sending a JMS message. The process is part of a transaction. If a later part of the transaction fails, a part that is after a previous part that sent the message, I need to cancel the message. One thought I had was to…
bmw0128
  • 1,625
  • 6
  • 25
  • 31
9
votes
1 answer

How can I do git merges in such a way that they are easy to roll back?

There is lots of talk about how it's not easy to "undo" a merge in git. Short version: if you undo a merge commit, it also tells git to never merge those changes back in in the future. Is there something I can do when doing the merge in order to…
John Bachir
  • 22,495
  • 29
  • 154
  • 227