diff --git a/eventful-sql-common.cabal b/eventful-sql-common.cabal
--- a/eventful-sql-common.cabal
+++ b/eventful-sql-common.cabal
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           eventful-sql-common
-version:        0.1.1
+version:        0.1.2
 synopsis:       Common library for SQL event stores
 description:    Common library for SQL event stores
 category:       Database,Eventsourcing
@@ -23,7 +23,6 @@
 library
   hs-source-dirs:
       src
-  default-extensions: ConstraintKinds DeriveFunctor DeriveGeneric FlexibleContexts FlexibleInstances FunctionalDependencies GADTs GeneralizedNewtypeDeriving MultiParamTypeClasses OverloadedStrings QuasiQuotes RankNTypes RecordWildCards ScopedTypeVariables StandaloneDeriving TemplateHaskell TupleSections TypeFamilies
   ghc-options: -Wall
   build-depends:
       base >= 4.9 && < 5
@@ -33,7 +32,6 @@
     , mtl
     , persistent
     , persistent-template
-    , split
     , text
     , uuid
   exposed-modules:
diff --git a/src/Eventful/Store/Sql/DefaultEntity.hs b/src/Eventful/Store/Sql/DefaultEntity.hs
--- a/src/Eventful/Store/Sql/DefaultEntity.hs
+++ b/src/Eventful/Store/Sql/DefaultEntity.hs
@@ -1,4 +1,8 @@
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE QuasiQuotes #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeFamilies #-}
 
 -- | Definition for a default Entity to use with a SQL event store.
 
diff --git a/src/Eventful/Store/Sql/JSONString.hs b/src/Eventful/Store/Sql/JSONString.hs
--- a/src/Eventful/Store/Sql/JSONString.hs
+++ b/src/Eventful/Store/Sql/JSONString.hs
@@ -1,3 +1,6 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE OverloadedStrings #-}
+
 module Eventful.Store.Sql.JSONString
   ( JSONString
   , jsonStringSerializer
diff --git a/src/Eventful/Store/Sql/Operations.hs b/src/Eventful/Store/Sql/Operations.hs
--- a/src/Eventful/Store/Sql/Operations.hs
+++ b/src/Eventful/Store/Sql/Operations.hs
@@ -1,3 +1,8 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeFamilies #-}
+
 module Eventful.Store.Sql.Operations
   ( SqlEventStoreConfig (..)
   , sqlGloballyOrderedEventStore
@@ -8,6 +13,7 @@
   ) where
 
 import Control.Monad.Reader
+import Data.Foldable (for_)
 import Data.Maybe (listToMaybe, maybe)
 import Data.Monoid ((<>))
 import Data.Text (Text)
@@ -46,9 +52,9 @@
 sqlEventToGloballyOrdered
   :: SqlEventStoreConfig entity serialized
   -> Entity entity
-  -> GloballyOrderedEvent (StoredEvent serialized)
+  -> GloballyOrderedEvent serialized
 sqlEventToGloballyOrdered config@SqlEventStoreConfig{..} (Entity key event) =
-  GloballyOrderedEvent (sqlEventStoreConfigUnKey key) $ sqlEventToStored config event
+  storedEventToGloballyOrderedEvent (sqlEventStoreConfigUnKey key) (sqlEventToStored config event)
 
 sqlEventToStored
   :: SqlEventStoreConfig entity serialized
@@ -88,7 +94,7 @@
   :: (MonadIO m, PersistEntity entity, PersistEntityBackend entity ~ SqlBackend)
   => SqlEventStoreConfig entity serialized
   -> SequenceNumber
-  -> SqlPersistT m [GloballyOrderedEvent (StoredEvent serialized)]
+  -> SqlPersistT m [GloballyOrderedEvent serialized]
 sqlGetAllEventsFromSequence config@SqlEventStoreConfig{..} seqNum = do
   entities <-
     selectList
@@ -113,11 +119,17 @@
 sqlStoreEvents
   :: (MonadIO m, PersistEntity entity, PersistEntityBackend entity ~ SqlBackend)
   => SqlEventStoreConfig entity serialized
+  -> Maybe (Text -> Text)
   -> (DBName -> DBName -> DBName -> Text)
   -> UUID
   -> [serialized]
   -> SqlPersistT m ()
-sqlStoreEvents config@SqlEventStoreConfig{..} maxVersionSql uuid events = do
+sqlStoreEvents config@SqlEventStoreConfig{..} mLockCommand maxVersionSql uuid events = do
   versionNum <- sqlMaxEventVersion config maxVersionSql uuid
   let entities = zipWith (sqlEventStoreConfigSequenceMakeEntity uuid) [versionNum + 1..] events
+  -- NB: We need to take a lock on the events table or else the global sequence
+  -- numbers may not increase monotonically over time.
+  for_ mLockCommand $ \lockCommand -> rawExecute (lockCommand tableName) []
   insertMany_ entities
+  where
+    (DBName tableName) = tableDBName (sqlEventStoreConfigSequenceMakeEntity nil 0 undefined)
diff --git a/src/Eventful/Store/Sql/Orphans.hs b/src/Eventful/Store/Sql/Orphans.hs
--- a/src/Eventful/Store/Sql/Orphans.hs
+++ b/src/Eventful/Store/Sql/Orphans.hs
@@ -1,4 +1,5 @@
 {-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# LANGUAGE OverloadedStrings #-}
 
 module Eventful.Store.Sql.Orphans
   (
