Magma Howto?

Markus Fritsche Fritsche.Markus at gmx.net
Wed Jul 2 19:00:36 UTC 2003


Chris Muller wrote:

> Most web applications later terminate a session after a given 
 > period of inactivity.  This would be an
> appropriate time to disconnect any associated Magma sessions.

Hm, it's shameless, but where can I find an example code snippet for a 
timeout?

> As you read in the Magma pages on the Swiki, you want to keep transactions as
> short as possible, and always avoid the scenario where a transaction is open
> while waiting for user-input.  What you do is capture the user-input, open a
> transaction, modify the domain objects, and commit the transaction, all in a
> single feedback to the user.

> [ myUserSession makeChangesToArticlesCollection ]
>   on: MagmaCommitError
>   do: [ : errorInfo | ... notify the user to try again ... ]

And editing a single article would be like
[ mySession commit: [ self call: ArticleEditor new article: art ]]
   on: MagmaCommitError
   do: [ :e | "..." ]
?

Regards, Markus




More information about the Squeak-dev mailing list