I think we can do it as simply as
db_begin();
..stuff...
db_commit();
where those functions are essentially just...
db_begin()
{
db_query("BEGIN");
}
All versions of MySQL since 3.23.17 understand the BEGIN; statement and it's
up to the individual database drivers to do whatever they do with it. So we
can always safely emit the BEGIN; and COMMIT; statements regardless of the
selected database or version thereof. If someone is running MySQL without a
transactional table type, they can let dbmail-maintenance clean up any messes
on a periodic basis.
Aaron
Ilja Booij <ilja@ic-s.nl> said:
> Full recalculation is indeed part of the maintenance script. When doing
> this stuff, the need for transactions occured to me.. I guess the
> maintenance program can serve as for a while, after which we should
> really use transactions (and possibly other ACID related features).
>
>
> Ilja
>
>
>
> Aaron Stone wrote:
>
> > This also underscores the need for transactions, otherwise it would be
> > possible for two messages to be inserted at almost the same time and lose
> > count of the size of one of those messages. A full recalculation as part of
> > the maintenance script might tide us over in the mean time...
> >
> > Aaron
> >
> >
> > Ilja Booij <ilja@ic-s.nl> said:
> >
> >
> >>I've made some minor adjustments to the way quota are handled. Or
> >>rather, to the way that a user's quotum is updated. Instead of using
> >>db_calculate_quotum_used() after every insert, I've now used a new
> >>function db_add_quotum_used() which adds the message size to the new
> >>quotum.
> >>
> >>This is all fine, and it works, except for the fact that the
> >>curmail_size is not lowered again on deletion of a message. I'll fix
> >>that tomorrow. :)
> >>
> >>This stuff should gives us some more speed (less complex queries),
> >>especially on message insertion.
> >>
> >>Ilja
> >>
> >>_______________________________________________
> >>Dbmail-dev mailing list
> >>Dbmail-dev@dbmail.org
> >>http://twister.fastxs.net/mailman/listinfo/dbmail-dev
> >>
> >
> >
> >
> >
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>
--