Posted By: Doug Chasman
Date: 2006-02-25 17:30
Summary: ASF 0.3.2 adds support for boxcar'ed requests
Project: ActiveSalesforce
Full support for boxcar'ed requests using Rails transaction semantics, e.g.:
def test_batch_insert
c1 = Contact.new(:first_name => 'FN1', :last_name => 'LN1')
c2 = Contact.new(:first_name => 'FN2', :last_name => 'LN2')
c3 = Contact.new(:first_name => 'FN3', :last_name => 'LN3')
Contact.transaction(c1, c2) do
c1.save
c2.save
end
c3.save
c1.first_name << '_2'
c2.first_name << '_2'
c3.first_name << '_2'
Contact.transaction(c1, c2) do
c1.save
c2.save
end
Contact.transaction(c1, c2) do
c3.save
c3.destroy
c2.destroy
c1.destroy
end
end
end
ASF boxcar support automatically homogenizes requests based on the salesforce.com api verb (e.g. :create, :update, :delete) and will automatically break sets larger than the salesforce.com api's max per batch (the limit is currently 200 rows per request) into multiple requests! This is fully operational for insert, update, and delete. |
|