packages feed

simple-postgresql-orm 0.8.0 → 0.9.0.0

raw patch · 2 files changed

+2/−10 lines, 2 files

Files

simple-postgresql-orm.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                simple-postgresql-orm-version:             0.8.0+version:             0.9.0.0 synopsis:            Connector package for integrating postgresql-orm with the Simple web framework description:            Connector package for integrating postgresql-orm with the Simple web framework homepage:            http://simple.cx
src/Web/Simple/PostgreSQL.hs view
@@ -5,7 +5,6 @@   ) where  import Control.Monad-import Control.Monad.IO.Class import qualified Data.ByteString.Char8 as S8 import Data.Pool import Database.PostgreSQL.ORM@@ -48,12 +47,5 @@                => (Connection -> Controller hs b) -> Controller hs b withConnection func = do   pool <- postgreSQLConn `fmap` controllerState-  -- Stick the dbvar in an IORef so we can replace it if there is an-  -- exception. Always fill dbvar at the end, exception or otherwise.-  bracket (liftIO $ takeResource pool)-          (\(conn, lp) -> liftIO $ putResource lp conn) $-          funcE pool-        -- run the function, but on exceptions treat the connection as dead-  where funcE pool (conn, lp) = do-          (func conn) `onException` (liftIO $ destroyResource pool lp conn)+  withResource pool func