Fixed rise of Duplicate exception for DB

We should be able to distinguish duplicate error
and common db error correctly, without dependency
on exception message.

Change-Id: I7a9e20841f611a8ec8b69b79314e02fc46a7a758
Merge "Fixed rise of Duplicate exception for DB"