# Scripts rolling back automatically?

**URL:** <https://forums.toadworld.com/t/scripts-rolling-back-automatically/9351>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [March 17, 2010, 9:18am UTC](https://forums.toadworld.com/t/scripts-rolling-back-automatically/9351 "2010-03-17T09:18:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsschw](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsschw](https://forums.toadworld.com/u/dsschw)\
**Post date:** [March 17, 2010, 9:18am UTC](https://forums.toadworld.com/t/scripts-rolling-back-automatically/9351/1 "2010-03-17T09:18:05Z")

</div>

Hello all,

I’m running Toad for Oracle version 9.7.2.5 and having a strange problem. Whenever I use the “Execute as a Script” (lightning bolt) button, the changes get rolled back automatically immediately after TOAD gets to the end of the script. This happens for a wide variety of scripts, never throws any errors and the code that I’m trying to execute works fine if I choose “Execute Statement” instead.

The only way that I’m able to view and/or keep the changes from statements Executed as a Script from being rolled back automatically is to write a COMMIT and execute it along with them (a practice that is highly discouraged in my organization.)

Does anyone have experience with a problem like this and if so what did you do? Any ideas on what would cause this behavior?

---

<div class="post-metadata">

**Author:** ![GTDG](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/gtdg/32/140_2.png) [@GTDG](https://forums.toadworld.com/u/GTDG)\
**Post date:** [March 17, 2010, 9:18am UTC](https://forums.toadworld.com/t/scripts-rolling-back-automatically/9351/2 "2010-03-17T09:18:05Z")

</div>

Dan,

Two things to check:

Oracle -\> Transactions -\> Execute scripts in Toad session

Oracle -\> Transactions -\> When closing connections

If the first one is unchecked, the script engine will create a new session,  
execute the script, and close the session. If the second option is set to  
Rollback, that would explain the behavior you are seeing.

Greg

---

<div class="post-metadata">

**Author:** ![dsschw](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsschw](https://forums.toadworld.com/u/dsschw)\
**Post date:** [March 17, 2010, 11:29am UTC](https://forums.toadworld.com/t/scripts-rolling-back-automatically/9351/3 "2010-03-17T11:29:28Z")

</div>

Thanks for the reply, Greg.

In my Toad options, Execute scripts in Toad session is checked and when closing connections it is supposed to prompt for commit/rollback.

---

<div class="post-metadata">

**Author:** ![dsschw](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsschw](https://forums.toadworld.com/u/dsschw)\
**Post date:** [March 23, 2010, 10:16am UTC](https://forums.toadworld.com/t/scripts-rolling-back-automatically/9351/4 "2010-03-23T10:16:15Z")

</div>

Does anyone else have an opinion on what might cause this issue?
