Jade's weblog Archive

Neat trick with db_list

For OpenACS, I always wondered why someone would want to use a db_list. Here is an example, from a bug fix by Lars Pinds:

The problem was that the code said:

db_foreach select_forums { select forum_id from ... } {
    notification::request::new ...
}

which caused the db_foreach and the notification::request::new to use different database handles, which happens to mean they'll not be part of the same transaction. Hence this caused a deadlock.

I serialized the two db-calls to say

foreach forum_id [db_list select_forums {}] {
    notification::request::new ...
}

so that the db_list call returns before the foreach loop starts, causing the two to use the same transaction (or, rather, the inner call uses the active transaction).

02:49 AM, 23 Aug 2003 by Jade Rubick Permalink | Comments (0)

Today, I wed.

01:22 PM, 16 Aug 2003 by Jade Rubick Permalink | Comments (0)

Notes on using list-builder, which is an improvement on ad_table.

12:58 PM, 08 Aug 2003 by Jade Rubick Permalink | Comments (0)

XML

Notifications

You may request notification for Jade's weblog.

Syndication Feed

XML

Recent Comments

  1. Jade Rubick: Using hoptoad
  2. Jade Rubick: Much better
  3. Bodo Tasche: Link changed :)
  4. Bodo Tasche: Better commt emails. Now with color :)
  5. Jade Rubick: Filed a ticket
  6. Vinod Kurup: Wow
  7. Jade Rubick: Then what
  8. Paul Post: Percentages
  9. Paul Post: I might be an ENFJ?
  10. Lo Samuelson: Not the Myer's Briggs...