OpenJPAException narrow(String msg, SQLException ex, Object failed) {
int errorType = matchErrorState(sqlStateCodes, ex);
StoreException storeEx;
switch (errorType) {
case StoreException.LOCK:
storeEx = new LockException(failed);
break;
case StoreException.OBJECT_EXISTS:
storeEx = new ObjectExistsException(msg);
break;
case StoreException.OBJECT_NOT_FOUND: