workflowPersistencePlugin.onWorkflowsSaved(con, uncheckedWfs);
}
catch(SQLException e) {
// MySQL and DerbyDB throw a SQLIntegrityConstraintViolationException
if (e instanceof SQLIntegrityConstraintViolationException || (e.getCause() != null && e.getCause() instanceof SQLIntegrityConstraintViolationException)) {
throw new DuplicateIdException(e);
}
// Postgres handling
if (e.getMessage().contains("cop_workflow_instance_pkey") || (e.getNextException() != null && e.getNextException().getMessage().contains("cop_workflow_instance_pkey"))) {
throw new DuplicateIdException(e);
}
throw e;
}
finally {
JdbcUtils.closeStatement(stmtQueue);