[rt-users] Most efficient way to update custom fields without creating too many transactions

Kevin Falcone falcone at bestpractical.com
Thu Aug 29 16:31:24 EDT 2013


On Tue, Aug 27, 2013 at 09:36:53AM -0700, Landon Stewart wrote:
>    On 27 August 2013 09:27, Kevin Falcone <[1]falcone at bestpractical.com> wrote:
> 
>      It'd be safer to use the RecordTransaction argument to
>      AddCustomFieldValue which tells RT whether or not to record a
>      transaction.
> 
>      This avoids the problem of directly manipulating OCFVs and potentially
>      truncating them when you shove content > 255 into the Content field.
>      RT transparently bounces between the Content and LargeContent field as
>      needed if you use the API.
> 
>    So, to be clear here, if in my RT::Action::ModuleName action module if I use something like
>    this:
>    $Ticket->AddCustomFieldValue( Field => 'Customer', Value => join("\n", at customerids),
>    RecordTransaction => 0 );
>    And if @customerids contained a list of 1000 five or six digit numbers it would not choke on
>    that many because LargeContent would get used or because I'm not recording the transaction at
>    all? Or am I mistaken here somewhere still?

Because Custom Fields can hold a LONGBLOB worth of data.
Go save a large text CF and look in the database.
Saving them as 1000 individual values makes 1000 records in the
database, saving them as 1 large record makes 1 record.  These are
treated differently on update and display.

If you follow the advice of the wiki article that was linked to and
reach around the API, you'll hurt yourself.

Not recording transactions is orthogonal to the size of the data which
can be recorded.

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130829/9a31d383/attachment.sig>


More information about the rt-users mailing list