diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-11-19 21:40:55 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-11-19 21:40:55 +0100 |
commit | 505c913789ff8004139c90cd859192599cff226a (patch) | |
tree | fceab6ad9444868478c34805fcf8af6a07832da2 /sonar-core/src/main | |
parent | 0e28de827020f3bfdae0473fedc6d197ed80ad11 (diff) | |
download | sonarqube-505c913789ff8004139c90cd859192599cff226a.tar.gz sonarqube-505c913789ff8004139c90cd859192599cff226a.zip |
SONAR-3889 fix compatibility with PostgreSQL
Diffstat (limited to 'sonar-core/src/main')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/user/AuthorDao.java | 1 | ||||
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/user/AuthorDao.java b/sonar-core/src/main/java/org/sonar/core/user/AuthorDao.java index 0b709f8d45d..610ba326709 100644 --- a/sonar-core/src/main/java/org/sonar/core/user/AuthorDao.java +++ b/sonar-core/src/main/java/org/sonar/core/user/AuthorDao.java @@ -63,6 +63,7 @@ public class AuthorDao implements BatchComponent, ServerComponent { session.commit(); } catch (RuntimeException e) { // break the unique index on LOGIN ? + session.rollback(); AuthorDto persistedAuthor = mapper.selectByLogin(authorDto.getLogin()); if (persistedAuthor != null) { authorDto.setId(persistedAuthor.getId()); diff --git a/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml b/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml index 684bdd2efad..4071f72247b 100644 --- a/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml @@ -4,7 +4,7 @@ <mapper namespace="org.sonar.core.user.AuthorMapper"> <select id="selectByLogin" parameterType="string" resultType="Author"> - SELECT id, person_id AS "personId", login, created_at AS "createdAt", updated_at AS "updatedAt" + SELECT id, person_id AS personId, login, created_at AS createdAt, updated_at AS updatedAt FROM authors WHERE login=#{id} </select> |