Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Do not start a transaction for a SELECT query

  • Loading branch information...
commit 12630f91179d35d200ae05460e4ab1800718aec8 1 parent 03cce17
@norm2782 authored
Showing with 4 additions and 5 deletions.
  1. +1 −1  snaplet-hdbc.cabal
  2. +3 −4 src/Snap/Snaplet/Auth/Backends/Hdbc.hs
View
2  snaplet-hdbc.cabal
@@ -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
View
7 src/Snap/Snaplet/Auth/Backends/Hdbc.hs
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.