[Seaside] Session. Where to put DB connect/disconnect code.

Dmitry Dorofeev dima-sender-3c337a at yasp.com
Wed Mar 2 13:40:43 CET 2005


Hi all,

I finally managed to connect to Postgres from Squeak and now shaping my code to be nice :-)

I red http://www.techgame.net/projects/Seaside/wiki/UsingGOODS and found it useful,
So now i have lazy initialization of my PostgreSQL connection as article suggested
and have one connection to DB per Session so i can easily have complex commits/rollbacks
which are hardly possible unless you use Seaside.

The question is where to put PostgreSQL disconnect code ?

I tried to overwrite Session>>expire but it never called (Yes i waited 600 seconds to check it).

Example in the doc says
withEscapeContinuation: aBlock
   ^ (self db) commitWithRetry: [super withEscapeContinuation: aBlock]

But it is unclear for me what it is and when it get called.

Thank you !
-- 
Dmitry Dorofeev           ** dima at yasp.com **


More information about the Seaside mailing list