rollback

Rails - returning false from before_create prevents changes to other models

I have a before_create filter that checks if people are posting too many comments. If they are I want to flag their account. class Comment < ActiveRecord::Base before_create :check_rate_limit def check_rate_limit comments_in_last_minute = self.user.comments.count(:conditions => ["comments.created_at > ?", 1.minute.ago]) if...

Rolling back database changes

Hi, I work in team which uses Work flow management tool. I was presented with a challenge where the user should be able to roll back the changes made anytime during the flow to a certain point in the past. Surely the toll can handle it but the additional database calls that may have made during these activities have to be manually rol...

Why does Mercurial only have one level of rollback?

I understand the restrictions of rollback and the care required in its use (for example, http://www.selenic.com/mercurial/hg.1.html#rollback), but I just wondered why there is only 1 level of rollback. My guess it's a design decision and that the hassle of storing multiple previous transactional states to handle multiple levels of rollb...

PHP script aborts, causes MySQL transaction to fail, whole app locks for a little while

I'm using transactions in a MySQL database, along with Ajax, and I'm having some troubles with scripts timing out. So, here's a rundown of what happens: Ajax script on page makes request to server. Server receives request; script starts a MySQL transaction. Ajax script is set to timeout after two seconds; times out; tells server to abo...

git clone overwrote an existing repo with the same name

it had a existing git checkout and had made some modifications, then i checked out the same repo and it overwrote the folder. Is there some way to get the old repos with the uncommitted changes? I had checked " git reflog --all " but it only gave me the most recent checkout. ...

Git usage help, rolling back scenerios

if I made some changes, but didn't do a commit -m "my message, how can I rollback to where I was? if I did a commit -m 'my message' but didn't push to origin, how can I roll back? if I did a git pull origin , now I don't like what I got, how can I roll back to where I was? how can I get a list of what files are at the origin that have c...

Spring Test's @BeforeTransaction is still inside a transaction?

I'm using Spring Test and JUnit to run DAO integration tests. The test class is annotated as follows: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( { "/testPersist-applicationContext.xml" }) @Transactional I use the @BeforeTransaction annotation on a method to insert some test data -- that I would expect to be there ...

TF204000: The Team Foundation server to which your team project is connected does not support the Rollback command.

When I try to rollback my bad changeset using tf rollback /changeset:xx I'm getting next error: TF204000: The Team Foundation server to which your team project is connected does not support the Rollback command. Is it possible to fix that someway? Googling brings not result ...

Google App Engine: appcfg.py rollback

I'm using Windows 7 and for the life of me I cannot figure out how to call the rollback function on appcfg.py. All I want to know is what to type into the command prompt so I can rollback my app. ...

rails rolling back migration permanently then branching

This is a rails question about migration versions So i have a few migrations already existing. i.e. in my db/migrate/ folder i have some files like this: 1_add_products.rb 2_add_customers.rb 3_add_addresses.rb 4_add_tags.rb and i've ran "rake db:migrate" so the current version is 4. I want to go back to version 2 permanently and sta...

How to kill/resolve a reeeeally long-running update in SQL Server

A colleague of mine (I promise it was a colleague!) has left an update running on our main SQL Server since last Thursday (yes that's right folks, we're pushing 100 hours now!). The SQL in question (in one transaction, I might add) is: update daily_prices set min_date = (select min(a.date) from daily_prices a where a.key ...

Which should take initiative task on rollback, App or DB?

MySql InnoDB is set autocommit off and used default isolation level REPEATABLE READ. There are two scenarioes that two distinct transactions T1 and T2 run in the time sequence below, 1) time T1 T2 t1 update row 1->OK t2 update row 2->OK t3 update row 2->wait->timeout error t4 commit or rollb...

Trouble using MySQL transactions with loops in PHP

Hello all, I am trying to set up a MySQL transaction such that I can loop through a bunch of queries (see below) and if any of them fail, rollback all of the changes. I am finding however that if one fails, not all of the queries are rolled back. Am I doing anything wrong here? mysql_query("START TRANSACTION"); foreach($array1 as...

Roll back changes made by mistake in Excel 2007

While using Microsoft Excel 2007, something weird happened and all the names after the nth row change to ABCD and I saved the file by mistake. How do I bring back the old names which have changed to ABCD? ...

Click once application rollback

Is Click Once rollback possible. How can we do that. DOes this application download all files on update. How can we see which files are downloaded for update. Thanks ...

Managing mysql schema changes with SQL scripts and transactions

Hi all I am working with multiple databases in a PHP/MySQL application. I have development, testing, staging and production databases to keep in sync. Currently we're still building the thing, so it's easy to keep them in sync. I use my dev db as the master and when I want to update the others I just nuke them and recreate them from m...

Rollback @ Stored Procedure on Oracle

I don't know if thats right but for some reason my stored procedure is not rolling back after an exception occurs. So my insert statement is commited even when i get an exception Did i forgot something? PROCEDURE SP_USUARIO_INSERT ( pUSU_IDUSUARIO IN OUT ENG.USU_USUARIO.USU_IDUSUARIO%TYPE, pUSU_CDUS...

EJB 3.1 timer rollback exception

Hey fellows, I've been getting a load of rollbackexception when calling some SELECT JPQL or namedqueries from a Singleton. The Singleton as one method with the @Schedule annotation calling the some others db query which run fine. But once that shceduled method calls on some other methods which at their turn call db queries then everythi...

SQL Server: rollback after insert that contains an output inserted fails mysteriously.

A rollback after an insert that contains an output statement fails with "The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION." If the output statement is removed, then it works. Is there an explanation for this behavior? Example: create table test(i integer primary key) go begin transaction insert into test (i) va...

What happens if you don't roll back a transaction in Hibernate?

Everything I read about Hibernate states that you must roll back a transaction and close the session when an error occurs, and there's usually some variation of the following code (taken from Hibernate's docs) given as an example: Session sess = factory.openSession(); Transaction tx = null; try { tx = sess.beginTransaction(); //...