# ActiveRecord::Rollback not found?

**URL:** <https://www.ruby-forum.com/t/activerecord-rollback-not-found/136172>\
**Category:** Rails\
**Created:** [April 29, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/activerecord-rollback-not-found/136172 "2008-04-29T16:39:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ec8ea/32.png) [@praveen](https://www.ruby-forum.com/u/praveen)\
**Post date:** [April 29, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/activerecord-rollback-not-found/136172/1 "2008-04-29T16:39:43Z")

</div>

Hi All  
The docs mention that raising ActiveRecord::Rollback from within a  
‘transaction’ block causes the transaction to rollback without  
reraising it. However, trying this in script/console gives this error:

NameError: uninitialized constant ActiveRecord::Rollback

Doing a recursive grep of /usr/lib/ruby doesn’t find any mention of  
ActiveRecord::Rollback!! Am I doing something wrong? What’s the  
‘right’ way to rollback a transaction explicitly from within a  
‘transaction’ block?

thanks

---

<div class="post-metadata">

**Author:** ![praveen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ec8ea/32.png) [@praveen](https://www.ruby-forum.com/u/praveen)\
**Post date:** [April 29, 2008, 5:36pm UTC](https://www.ruby-forum.com/t/activerecord-rollback-not-found/136172/2 "2008-04-29T17:36:06Z")

</div>

On 29 Apr 2008, at 15:38, Praveen wrote:

> Hi All  
> The docs mention that raising ActiveRecord::Rollback from within a  
> ‘transaction’ block causes the transaction to rollback without  
> reraising it. However, trying this in script/console gives this error:
> 
> NameError: uninitialized constant ActiveRecord::Rollback

Well it’s defined in Activerecord’s base.rb (it just defined as class  
Rollback (but inside the AR module) which is why your search didn’t  
find it).  
and ActiveRecord::Rollback seems to exist for me.

Fred
