Scrip "too fast" or dirty read from db or what?

Hi List,

I have the following problem on an RT 3.8.8:
There is a simple scrip that notifies the owner on comments. Sometimes this
scrip sends
"This transaction appears to have no content" instead of the real textural
content of the incoming e-mail.
This problem mainly present if there are file attachements of the email.

But if I run the following code from CLI the outgoing mail contains the
good content not the “This trans…” warning message:
my $tic = RT::Ticket->new($RT::SystemUser);
$tic->Load(id_of_ticket);

my $tr = RT::Transaction->new($RT::SystemUser);
$tr->Load(id_of_incoming_mail_comment_transaction);

my $scrip = RT::Scrip->new($RT::SystemUser);
$scrip->Load(id_of_notify_owner_scrip);

$scrip->Prepare(TicketObj => $tic, TransactionObj => $tr);
$scrip->Commit(TicketObj => $tic, TransactionObj => $tr);

So it seems to me that scrip runs earlier than the attachements of
transaction inserted into the DB
or there is some kind of MySQL cache problem which causes dirty read
but there aren’t any special MySQL settings.

What do you think?

Thanks,
Bekeny