rollback

Rolling back a test (SQL Server 2008) with TestDriven.NET in Visual Studio 2010

How do I cause all my tests to do a rollback on the SQL Server 2008 database from my Visual Studio 2010 test harness? I'm using TestDriven.NET to run the tests. ...

perl dbi rollback not working

Hello, i am using this approach. If there is an error in the sql, rollback only happens for the first id of the asset_group. Rest of the ids are ignored. Am i doing it the right way? my $sql = "sql batch that update and insert depending on the condition"; $dbh->{RaiseError} = 1; $dbh->{PrintError} = 0; $dbh->{AutoCommit} = 0; m...

VB OracleTransaction Not Rolling back

Hi, I'm calling a third party stored procedure in Oracle from VB that is not rolling back. Code first (I'm simplifying): Connection string: String sqlstr = "SERVER=x.x.x.x;Database=db;uid=sa;pwd=admin;Connect Timeout=60; Min Pool Size=5; Max Pool Size=100;"; The call (I've just forced a rollback immediately after the execute to tes...

ActiveRecord Rollback does not work in Rails test

Throwing ActiveRecord::Rollback works, but not in tests. I've had this problem before, am now having it again, and for some reason can't find any record of someone else having this problem. I'm this is because tests do a rollback each time a test runs, and most databases don't support nested rolllbacks. However, I can't be the only pe...

Create custom rollback

So I am going through our database and removing some unneeded access levels that are basically duplicates of other ones. Our database structure has a column user_level which is an enum that has a bunch of different strings (I know this isn't a great way to run user access levels but this is how the original developer made it). What I am...

Is rollback needed if java.sql.Connection#commit() throws exception?

According to JAVA documentation, Connection#commit() can throw SQLException. My question is whether or not a rollback should still be issued in this scenario. For example: Connection con = null; try { // assume this method returns an opened connection with setAutoCommit(false) con = createConnection(); // do DB stuff ...

MySql stored procedures, transactions and rollbacks

I can't find an optimal way to use transactions in a MySql Stored Procedure. I want to rollback if anything fails: BEGIN SET autocommit=0; START TRANSACTION; DELETE FROM customers; INSERT INTO customers VALUES(100); INSERT INTO customers VALUES('wrong type'); COMMIT; END 1) Is autocommit=0 required? 2) If t...

UserTransaction issue in java

I have existing project which uses 2 database (DB2),and the records which are saved in the 2 databases are related.So the transactions need to be maintained.Eg whenever a new thing is to be added then entries must be done to x number of tables in Database1 and and y number of tables in database2. Now in the code that is preexisting(devel...

How do I go back to an earlier commit of a file using git?

I am working on a file where the my current commit ended up being bad and I want to go back to earlier commits for a specific file? I did a search it looks like no one has answered a similar question (how to roll back changes in a file in a previous commit in git).... Hopefully a simple answer? ...

Ignore validation failure when using accepts_nested_attributes_for (i.e. prevent rollback)?

So suppose I have the Person and Child models: class Person < ActiveRecord::Base has_many :children accepts_nested_attributes_for :children end class Child < ActiveRecord::Base belongs_to :parent, :class_name => "Person" validates_presence_of :name end Now when I use a nested form and save a Person with 2 new children...

sql server rollback...

Possible Duplicate: SQL Identity (autonumber) is Incremented Even with a Transaction Rollback does a rollback also rollback identity values??? ...

SQL Server 2008 Transaction, rollback required?

Hi, I have a stored procedure that has a BEGIN TRANSACTION and COMMIT TRANSACTION statement. Within the transaction is a select query WITH(XLOCK, ROWLOCK). The transaction can potentially fail due to some calculations that cause an arithmetic overflow error if out of bounds values are supplied. This error would happen before any inser...

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 is a deadlock or timeout or livelock exception). ...

How to rollback if any update is not success?

I have written a transaction like: BEGIN TRAN UPDATE [Table1] SET [Name] = 'abcd' WHERE [ID] = 1 UPDATE [Table2] SET [Product] = 'efgh' WHERE [ID] = 10 UPDATE [Table3] SET [Customar] = 'ijkl' WHERE [ID] = 11 Now I want to rollback if any UPDATE is not success. For example in Table2 i...

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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback;...