|
|
Choosing A Webhost: |
Re: Transactions, database connections, indices, GOODS and Seaside: msg#00076lang.smalltalk.squeak.seaside
On May 12, 2004, at 1:24 PM, C. David Shaffer wrote: So, how to people deal with this? Just a push in the right direction would be helpful. Avi, if you recall I asked you about this at your tutorial at SS last year and walked away thinking that it would be obvious once I got started. Now, a full year later I can't remember why it should be obvious :-) Each Seaside session is guaranteed to only be processing one request at a time. So you're actually perfectly safe to store the current transaction in the session for the duration of a request. The best override point is probably #responseForRequest: - something like this, I guess: responseForRequest: aRequest currentTransaction := self newTransaction. [super responseForRequest: aRequest] ensure: [currentTransaction commit. currentTransaction := nil]. There may be some subtleties here with error handling we'll have to work out (Julian?), but that's the basic idea. Or you can use a dynamic variable rather than storing it in the session - Seaside actually has its own WADynamicVariable implementation which you might find useful. To use it, define a subclass for each variable you want dynamic access to, then send #use:during: and #value (both on the class side) to set and get the value respectively. Avi
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Persistent object framework, Avi Bryant |
|---|---|
| Next by Date: | Re: novice question: WATask vs WAComponent, Avi Bryant |
| Previous by Thread: | Transactions, database connections, indices, GOODS and Seaside, C. David Shaffer |
| Next by Thread: | Re: Transactions, database connections, indices, GOODS and Seaside, Avi Bryant |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |