Surely this needs to be in the same try/catch as the insert above?  ie. If the insert fails then we can't fetch the new ID.

We should probably _select max(id)_ as well to make sure we've got the latest ID (different DB impls might have different default orderings).

I would have assumed the _Database_ interface would have had a _lastInsertId()_ method, but it doesn't... :(  Maybe worth adding it?