On 2013-08-27 19:30, Paul J Stevens wrote:
On 08/27/2013 11:51 AM, Thomas Raschbacher wrote:

I know what you mean about atomic DB stuff in code .. can be quite a pain. I am not entirely sure what is done during the migration, so can'T judge
about doing it in an SP ^^

Messages are basically retrieved (using the old messageblks storage) and
stored again (using the mimeparts storage).

The whole procedure is wrapped in a transaction:

BEGIN;
Fetch a limited number of physmessage_ids from the messageblks table.
For each physmessage_id:
  retrieve message
  store message
  if store is successful:
    delete message rows from messageblks
COMMIT;

All in src/maintenance, do_migrate

Ah thanks might have a look.

I do have some experience with Stored Procedures, so if you needed
something specific (Postgres mostly) I can probably help. I had to write
a lot of Stored Procedured (for MS SQL though) in one of my previous
jobs (some of them were ridiculously long because they had grown which
is also a pain of course).


Main problem is (in general when dealing with DBMail) is that such
procedures would have to be written and tested on all three backends.
Patches that only deal with one specific backend are rejected. I don't
expect anyone to deal with Oracle, but the other three are open-source
and readily available.

I understand that of course.
Tbh I have no clue as to how much sqlite does support transactions.. maybe
look it up at some point.

in any case my messages are (finally) all migrated anyway but still might be
good idea to look into using Stored procedures for other things maybe.
Tbh I would guess that the message migration will probably soon be a thing of the past anyway (at least 2.2 -> 3.x) so probably not worth the effort anymore, since the migration now works fine nearly all the time (and this error might've even been caused by me pressing ctrl+c at some point since
I put a too high message number once or twice) ;)
 -- or are you aware of a lot of 2.2. servers still?
_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to