Hi all,
I'm parsing an XML file with a few thousand elements in it for insertion into a sql database. Everything works fine with sqlite, but postgres dies on me with this error:
PGError: ERROR: out of shared memory
I was monitoring locks, and it looks like there's a lock for each insert statement, and although I'm just looping over activerecord "save" calls (which should have a transaction each) these locks seem to hang around such that I have a few thousand open at a time.
As an experiment, I wrapped the save calls in a transaction:
Coupon.connection.transaction do
@coupon.save!
end
And that appears to have resolved my locks issue. However, it does seem there is something wrong here. Anyone know what it might be? I am using the "pg" driver.
Thanks, Tom