DBIx::Class populate Gotcha
Today, we watched a series of test cases failing. Our tests started with a blank database and a series of populate method-calls to create their own test records.
Everything looked obviously right, but after a while of debugging, we found out that the populate method of DBIx::Class::ResultSet behaves differently depending on the context used. In Scalar or List context, the records are inserted using the INSERT statement, while in void context, a bulk insert method is used.
From a performance standpoint, this absolutely makes sense. The documentation does explain this very well.…