The other versions I looked at were maintaining a cache of IDs at the class instance level, which I presume is why the method was synchronized. This seems overkill for SQLite since performance is unlikely to be a consideration.