Tag Archives: cdbi

Class::DBI transactions

This is something I did at work just before Christmas, which is kind of useful. Some years ago, I came up with the original method do_transaction() for Class::DBI. However, it’s kind of clunky to use, as the example shows. Music::DBI->do_transaction( sub { my $artist = Music::Artist->insert({ name => ‘Pink Floyd’ }); my $cd = $artist->add_to_cds({ […]


Matt Biddulph has just had an article published on xml.com, REST on rails. It’s a really great way of working, and I encourage closer scrutiny. And it shows off Rails at its best. I really look forward to playing with Rails more. I would like to implement PUT for that rest_resource method as well… It […]

Class::DBI, PostgreSQL and Transactions

Once again, I managed to see the dreaded ”<IDLE> in transaction” message from PostgreSQL today. This means that I have a connection to the database open, which is currently inside a transaction. This is bad because locks are held open in a transaction. So, what to do about it? Firstly, examine the documentation.