@@ -524,7 +524,8 @@ convertError fs vs n = Left . SomeException $ ConversionFailed
524-- for more information.
524-- for more information.
526data IsolationLevel
526data IsolationLevel
527+ = DefaultIsolationLevel
527− = ReadCommitted
528+ | ReadCommitted
528 | RepeatableRead
529 | RepeatableRead
529 | Serializable
530 | Serializable
530 deriving (Show, Eq, Ord, Enum, Bounded)
531 deriving (Show, Eq, Ord, Enum, Bounded)
@@ -540,7 +541,7 @@ data TransactionMode = TransactionMode {
540 } deriving (Show, Eq)
541 } deriving (Show, Eq)
542defaultTransactionMode :: TransactionMode
543defaultTransactionMode :: TransactionMode
543−defaultTransactionMode = TransactionMode ReadCommitted ReadWrite
544+defaultTransactionMode = TransactionMode DefaultIsolationLevel ReadWrite
545defaultIsolationLevel :: IsolationLevel
546defaultIsolationLevel :: IsolationLevel
546defaultIsolationLevel = ReadCommitted
547defaultIsolationLevel = ReadCommitted
@@ -594,10 +595,14 @@ beginLevel lvl = beginMode defaultTransactionMode { isolationLevel = lvl }
594beginMode :: TransactionMode -> Connection -> IO ()
595beginMode :: TransactionMode -> Connection -> IO ()
595beginMode mode conn = do
596beginMode mode conn = do
596 execute_ conn $! case mode of
597 execute_ conn $! case mode of
597− TransactionMode ReadCommitted ReadWrite ->
598+ TransactionMode DefaultIsolationLevel ReadWrite ->
599− TransactionMode ReadCommitted ReadOnly ->
600+ TransactionMode DefaultIsolationLevel ReadOnly ->
600 "BEGIN READ ONLY"
601 "BEGIN READ ONLY"
602+ TransactionMode ReadCommitted ReadWrite ->
603+ "BEGIN ISOLATION LEVEL READ COMMITTED"
604+ TransactionMode ReadCommitted ReadOnly ->
605+ "BEGIN ISOLATION LEVEL READ COMMITTED READ ONLY"
601 TransactionMode RepeatableRead ReadWrite ->
606 TransactionMode RepeatableRead ReadWrite ->
602 "BEGIN ISOLATION LEVEL REPEATABLE READ"
607 "BEGIN ISOLATION LEVEL REPEATABLE READ"
603 TransactionMode RepeatableRead ReadOnly ->
608 TransactionMode RepeatableRead ReadOnly ->