On Thu, 2003-10-16 at 09:57, Chris Mason wrote: > Ok, here's a patch for dbmail 1.2 cvs that implements the transaction > begin/commit for mysql during pipe.c:insert_messages, and the imap > copy/append message commands.
Great, dbmail should be using transactions, why use a database if you don't use transactions. > It does not touch postgres, so applying this for postgres won't even > compile. Use at your own risk, I haven't tried huge attachments with it > yet. Would really love to see this in postgres also, maybe I'll get motivated at some point... Couple of minor comments about the code, You have created two new database functions called: db_start_transaction() and db_stop_transaction() I would recommend changing them to something like: db_begin_transaction() (begin is standard word) db_commit_transaction() (stop is ambiguous) also I would add: db_rollback_transaction() There will probably be times we want to rollback our work if we find an error. Great work, glad to see dbmail getting more robust. In general I have always thought we could benefit from using the database to do more for us, rather than having to implement things ourselves. Foreign keys are a good example, when we delete the last entry in the message table, the database should automatically delete all entries in the phs_message table and in the msg_blocks table for us. Matthew