diff --git a/Readme.markdown b/Readme.markdown
--- a/Readme.markdown
+++ b/Readme.markdown
@@ -72,7 +72,8 @@
 main = do
     let url = "host=$host dbname=$db user=$user password=$pw"
     con <- connectPostgreSQL (BS8.pack url)
-    void $ runMigration $ MigrationContext MigrationInitialization True con
+    withTransaction con $ runMigration $ 
+        MigrationContext MigrationInitialization True con
 ```
 
 For file-based migrations, the following snippet can be used:
@@ -83,7 +84,8 @@
     let url = "host=$host dbname=$db user=$user password=$pw"
     let dir = "."
     con <- connectPostgreSQL (BS8.pack url)
-    void $ runMigration $ MigrationContext (MigrationDirectory dir) True con
+    withTransaction con $ runMigration $ 
+        MigrationContext (MigrationDirectory dir) True con
 ```
 
 To run Haskell-based migrations, use this:
@@ -95,8 +97,8 @@
     let name = "my script"
     let script = "create table users (email varchar not null)";
     con <- connectPostgreSQL (BS8.pack url)
-    void $ runMigration $ MigrationContext 
-        (MigrationScript name script) True con
+    withTransaction con $ runMigration $ 
+        MigrationContext (MigrationScript name script) True con
 ```
 
 Validations wrap _MigrationCommands_. This means that you can re-use all
@@ -109,12 +111,21 @@
 main :: IO ()
 main = do
     let url = "host=$host dbname=$db user=$user password=$pw"
-    let name = "my script"
-    let script = "create table users (email varchar not null)";
     con <- connectPostgreSQL (BS8.pack url)
-    void $ runMigration $ MigrationContext 
-        (MigrationValidation (MigrationDirectory dir)) verbose con
+    withTransaction con $ runMigration $ MigrationContext 
+        (MigrationValidation (MigrationDirectory dir)) True con
 ```
+
+Database migrations should always be performed in a transactional context. 
+
+The standalone binary takes care of proper transaction handling automatically.
+
+The library does not make any assumptions about the current transactional state
+of the system. This way you can execute multiple migration-commands or
+validations in sequence while still staying in the same transaction.
+
+The tests work in a similar way. After executing all migration-tests, the 
+transaction is rolled back.
 
 ## Compilation and Tests
 The program is built with the _cabal_ build system. The following command
diff --git a/postgresql-simple-migration.cabal b/postgresql-simple-migration.cabal
--- a/postgresql-simple-migration.cabal
+++ b/postgresql-simple-migration.cabal
@@ -1,5 +1,5 @@
 name:                       postgresql-simple-migration
-version:                    0.1.2.0
+version:                    0.1.3.0
 synopsis:                   PostgreSQL Schema Migrations
 homepage:                   https://github.com/ameingast/postgresql-simple-migration
 Bug-reports:                https://github.com/ameingast/postgresql-simple-migration/issues
diff --git a/src/Database/PostgreSQL/Simple/Migration.hs b/src/Database/PostgreSQL/Simple/Migration.hs
--- a/src/Database/PostgreSQL/Simple/Migration.hs
+++ b/src/Database/PostgreSQL/Simple/Migration.hs
@@ -49,7 +49,7 @@
 import           System.Directory                   (getDirectoryContents)
 
 -- | Executes migrations inside the provided 'MigrationContext'.
--- 
+--
 -- Returns 'MigrationSuccess' if the provided 'MigrationCommand' executes
 -- without error. If an error occurs, execution is stopped and
 -- a 'MigrationError' is returned.
diff --git a/src/Database/PostgreSQL/Simple/Util.hs b/src/Database/PostgreSQL/Simple/Util.hs
--- a/src/Database/PostgreSQL/Simple/Util.hs
+++ b/src/Database/PostgreSQL/Simple/Util.hs
@@ -11,10 +11,13 @@
 
 module Database.PostgreSQL.Simple.Util
     ( existsTable
+    , withTransactionRolledBack
     ) where
 
+import           Control.Exception          (finally)
 import           Control.Monad              (liftM)
-import           Database.PostgreSQL.Simple (Connection, Only (..), query)
+import           Database.PostgreSQL.Simple (Connection, Only (..), begin,
+                                             query, rollback)
 
 -- | Checks if the table with the given name exists in the database.
 existsTable :: Connection -> String -> IO Bool
@@ -22,3 +25,9 @@
     liftM (not . null) (query con q (Only table) :: IO [[Int]])
     where
         q = "select count(relname) from pg_class where relname = ?"
+
+-- | Executes the given IO monad inside a transaction and performs a roll-back
+-- afterwards (even if exceptions occur).
+withTransactionRolledBack :: Connection -> IO a -> IO a
+withTransactionRolledBack con f =
+    begin con >> finally f (rollback con)
diff --git a/src/Main.hs b/src/Main.hs
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -15,7 +15,8 @@
 
 import           Control.Monad                        (void)
 import qualified Data.ByteString.Char8                as BS8 (pack)
-import           Database.PostgreSQL.Simple           (connectPostgreSQL)
+import           Database.PostgreSQL.Simple           (connectPostgreSQL,
+                                                       withTransaction)
 import           Database.PostgreSQL.Simple.Migration (MigrationCommand (..),
                                                        MigrationContext (..),
                                                        runMigration)
@@ -37,15 +38,15 @@
     void $ case cmd of
         Initialize url -> do
             con <- connectPostgreSQL (BS8.pack url)
-            runMigration $ MigrationContext
+            withTransaction con $ runMigration $ MigrationContext
                 MigrationInitialization verbose con
         Migrate url dir -> do
             con <- connectPostgreSQL (BS8.pack url)
-            runMigration $ MigrationContext
+            withTransaction con $ runMigration $ MigrationContext
                 (MigrationDirectory dir) verbose con
         Validate url dir -> do
             con <- connectPostgreSQL (BS8.pack url)
-            runMigration $ MigrationContext
+            withTransaction con $ runMigration $ MigrationContext
                 (MigrationValidation (MigrationDirectory dir)) verbose con
 
 parseCommand :: [String] -> Maybe Command
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -13,19 +13,12 @@
     ( main
     ) where
 
-import           Control.Exception                        (finally)
-import           Database.PostgreSQL.Simple               (begin,
-                                                           connectPostgreSQL,
-                                                           rollback)
+import           Database.PostgreSQL.Simple               (connectPostgreSQL)
 import           Database.PostgreSQL.Simple.MigrationTest (migrationSpec)
+import           Database.PostgreSQL.Simple.Util          (withTransactionRolledBack)
 import           Test.Hspec                               (hspec)
 
 main :: IO ()
 main = do
     con <- connectPostgreSQL "dbname=test"
-    begin con
-    finally
-        (hspec (migrationSpec con))
-        (rollback con)
-
-
+    withTransactionRolledBack con (hspec (migrationSpec con))
