Permalink
Browse files

Do not start a transaction for a SELECT query

  • Loading branch information...
1 parent 03cce17 commit 12630f91179d35d200ae05460e4ab1800718aec8 @norm2782 committed Nov 1, 2011
Showing with 4 additions and 5 deletions.
  1. +1 −1 snaplet-hdbc.cabal
  2. +3 −4 src/Snap/Snaplet/Auth/Backends/Hdbc.hs
View
@@ -1,5 +1,5 @@
name: snaplet-hdbc
-version: 0.6.2
+version: 0.6.2.1
synopsis: HDBC snaplet for Snap Framework
description: This snaplet consists of two parts: an HDBC abstraction snaplet
and an HDBC authentication backend for Snap's authentication
@@ -251,10 +251,9 @@ prepExec conn qry vals = withTransaction conn $ \conn' -> do
authQuery :: HdbcAuthManager -> (String, [SqlValue]) -> IO (Maybe AuthUser)
authQuery (HdbcAuthManager pool tbl _) (qry, vals) = withResource pool $
\conn -> do
- res <- withTransaction conn $ \conn' -> do
- stmt <- prepare conn' qry
- _ <- execute stmt vals
- fetchRowMap stmt
+ stmt <- prepare conn qry
+ _ <- execute stmt vals
+ res <- fetchRowMap stmt
return $ (return . mkUser tbl) =<< res
mkUser :: AuthTable -> Map String SqlValue -> AuthUser

0 comments on commit 12630f9

Please sign in to comment.