Displaying 20 results from an estimated 10000 matches similar to: "how do you manually cause a rollback in a transaction?"
2010 Jul 23
7
fail rollback transaction with manual raise exception
With :
PostgreSQL 8.4 or postgresql-8.3
rails 2.3.4
pg 9.x or pg 8.x
I test this code:
=========================
class NkiBatch < ActiveRecord::Base
Bank.connection.transaction do
bank = Bank.new(:name => "ddsjdsjdsjk")
bank.save!
raise ActiveRecord::Rollback.new
end
end
and this:
=========================
class NkiBatch < ActiveRecord::Base
2011 May 08
1
Transaction - but no rollback?
Hello,
I''m having trouble with transactions with rails 3.0.3 and mysql 5. I''d
like to import data etl-batch-style:
class Job < ActiveRecord::Base
# ...
def perform_etl
connection.transaction do
extract # some connection.execute / job.update_attribute stuff
transform # some connection.execute / job.update_attribute stuff
end
end
#...
end
2007 Dec 11
3
Transactional/Rollback problems
I''m having a rollback problem with rspec trunk. It doesn''t seem like
rollbacks are happening quite as often as they should be. It
appears as though the rollbacks are *NOT* occurring on the first
description block in a file, but are for the rest. Here is a set of
specs that are failing:
require File.dirname(__FILE__) + "/../spec_helper"
describe
2005 Nov 30
3
How to do a rollback
Hi. I''d like to know how can i do a rollback after a
Table.new(params:id)?
thank you
--
Posted via http://www.ruby-forum.com/.
2009 Feb 05
0
SQL transaction rollback isn't logged !
I''m finding that if I do something like this:
X.transaction { X.create(...); raise(''stop'') }
Then I see the INSERT statement in my logs, but I don''t see the BEGIN
or END for the transaction, or the ROLLBACK.
The transaction is definitely working: Without the raise(), the X
object is created; with the raise(), it is not. In both cases, the
log is
2006 Oct 03
2
Rails transactions issue with rollback.
Hi,
I have a transaction in which a duplicate key exception is being thrown
by MySQL. I assume this happens when I try to do a save. The problem
is that before the save, I do a destroy on another object as part of the
transaction. Catching the exception by doing this,
User.transaction do
begin
objA.destroy
objB.save <-- causing exception
rescue Exception => exc
2007 Apr 08
8
SQLite3 build is broken because calling rollback!() doesn't prevent COMMIT
I know why SQLite3 is broken. This code:
Topic.transaction do |transaction|
transaction.rollback!
end
results in the following database commands:
BEGIN;
ROLLBACK;
COMMIT;
In other words, there is a COMMIT when no transaction is in flight.
MySQL and Postgres are coll with it, but SQLite3 blows up with
indignation.
Recorded as a ticket: http://dev.rubyonrails.org/ticket/8030
2012 Aug 15
2
how best to rollback from a yum update?
Suppose I want to upgrade a bunch of packages on a system, but in case the upgrade produces unexpected, undesired results, I want to be able to rollback the system to its original state. What is the best way to do that?
Often, I won't have, or be able to find, packages for the current installed versions. I.e. If I haven't upgraded postgres for 2 years, it may be that I can no longer
2007 Sep 07
3
Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
Hi,
I am deploying a Rails website using Capistrano to a VPS running the
site through Apache and Mongrel.
''cap deploy'' works fine, and mongrels are restarted. When I execute
''cap deploy:rollback'', however, my script fails to restart the
mongrels giving this error:
!!! PID file tmp/pids/mongrel.5000.pid already exists. Mongrel could
be running already.
2007 Oct 08
3
test not rolling back
For testing, I use:
self.use_transactional_fixtures = true
This should cause a ROLLBACK for each test case. If I run a single
file, foo_controller_test.rb, it works as expected. I see BEGIN and
ROLLBACK 8 times in the log files. But if I run:
rake test:functionals
I get 3 COMMITs, 196 BEGINS and 193 ROLLBACKs. The code in fixtures.rb
that deals with this is :
def
2012 Jun 22
1
'yum update' rollback or .. ?
Hello,
we have several physical servers (CentOS 5.*) with rather critical applications where (because of stability)
we don't do regularly 'yum update'. In virtualized environemnts (under Vmware)
we do a snapshot, then 'yum update', reboot and if something is wrong we rollback the snapshot.
On physical servers we cannot do that. I have read about rollback option of rpm but not
2013 Jun 20
2
[PATCH V2] ocfs2: need rollback when journal_access failed in ocfs2_orphan_add()
While adding a file into orphan dir in ocfs2_orphan_add(),
it calls __ocfs2_add_entry() before ocfs2_journal_access_di().
If ocfs2_journal_access_di() failed, the file is added into
orphan dir, and orphan dir dinode updated, but file dinode
has not been updated.
Accordingly, the data is not consistent between file dinode
and orphan dir.
So, need to call ocfs2_journal_access_di() before
2006 Mar 28
2
Testing STI models
Hi everyone!
I have a question: what is the preferred way (in terms of simplicity) to
test models with single table inheritance. Right now I have 1 test case
and 1 fixture for all of the STI models, but it''s very hard to maintain
it (too many tests and records in fixture). It would be better if
fixtures could be named separately from DB tables.
I know, Engines plugin has
2012 Jan 11
1
How many "rollback" TXGs in a ring for 4k drives?
Hello all, I found this dialog on the zfs-devel at zfsonlinux.org list,
and I''d like someone to confirm-or-reject the discussed statement.
Paraphrasing in my words and understanding:
"Labels, including Uberblock rings, are fixed 256KB in size each,
of which 128KB is the UB ring. Normally there is 1KB of data in
one UB, which gives 128 TXGs to rollback to. When ashift=12 is
2009 Dec 11
7
Doing ZFS rollback with preserving later created clones/snapshot?
Hi.
Is it possible on Solaris 10 5/09, to rollback to a ZFS snapshot,
WITHOUT destroying later created clones or snapshots?
Example:
--($ ~)-- sudo zfs snapshot rpool/ROOT at 01
--($ ~)-- sudo zfs snapshot rpool/ROOT at 02
--($ ~)-- sudo zfs clone rpool/ROOT at 02 rpool/ROOT-02
--($ ~)-- LC_ALL=C sudo zfs rollback rpool/ROOT at 01
cannot rollback to ''rpool/ROOT at 01'': more
2010 Dec 08
2
Bug in nested transactions in rails 2.3.x
Hello!
According to ActiveRecord transactions documentation,
User.transaction do
User.create(:username => ''Kotori'')
User.transaction(:requires_new => true) do
User.create(:username => ''Nemu'')
raise ActiveRecord::Rollback
end
end
User.find(:all) # => Returns only Kotori
But I get both records in database (tested on
2006 Oct 17
3
Should fixtures be transactional?
I started using the new Model.should_have(1).records expectation in
rspec_on_rails, and quickly realized that my fixtures were remaining
loaded, even in contexts that didn''t use them. Bug or feature?
Jay Levitt
2008 Dec 17
1
RPM rollback/repackage with CentOS 4
Hi,
Is there any way to list availabe RPM rollback's and timestamps in CentOS 4?
It's possible to get RPM rollbacks with up2date, but appears that's
deprecated ;-(
# up2date --list-rollbacks
This feature is deprecated and no longer functional
I want a method to list current available rollback and the timestamp:
http://www.linuxjournal.com/article/7034
How do you deal with this
2006 Nov 04
8
alternatives to script/runner?
I''ve been using script/runner to add and delete files from the
database in response to inotify events. This works in theory, but is
too slow to keep up with a large number of events in succession; I''m
suspecting that the bottleneck is that script/runner has a huge
startup cost.
One thing I thought of was to queue inotify events, and call
script/runner once a minute to clear the
2007 Oct 19
2
Using raid 1 for rollback purposes
Hi All,
For quite some time I've used raid 1 as a means of providing a
rollback mechanism for an upgrade (which I learned from others long
ago). So essentially, before an upgrade you split the mirrors and
upgrade one side or the other. If your upgrade goes well you sync one
way, if your upgrade does not you sync the other (much hand waving and
chanting going on, as its more complicated than