Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java @ 161:e4a1562dfc21
Bugfixed the collection creation in the Backend.
artifacts/trunk@1386 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 03 Mar 2011 13:53:55 +0000 |
parents | db0d20440b92 |
children | 268c2972d4a7 |
comparison
equal
deleted
inserted
replaced
160:dc687827439f | 161:e4a1562dfc21 |
---|---|
1117 ResultSet result = null; | 1117 ResultSet result = null; |
1118 PreparedStatement stmnt = null; | 1118 PreparedStatement stmnt = null; |
1119 | 1119 |
1120 DataSource dataSource = DBConnection.getDataSource(); | 1120 DataSource dataSource = DBConnection.getDataSource(); |
1121 try { | 1121 try { |
1122 conn = dataSource.getConnection(); | |
1122 conn.setAutoCommit(false); | 1123 conn.setAutoCommit(false); |
1123 try { | 1124 try { |
1124 conn = dataSource.getConnection(); | |
1125 | |
1126 // fetch owner id | 1125 // fetch owner id |
1127 stmnt = conn.prepareStatement(SQL_USERS_SELECT_ID_BY_GID); | 1126 stmnt = conn.prepareStatement(SQL_USERS_SELECT_ID_BY_GID); |
1128 stmnt.setString(1, ownerIdentifier); | 1127 stmnt.setString(1, ownerIdentifier); |
1129 result = stmnt.executeQuery(); | 1128 result = stmnt.executeQuery(); |
1130 | 1129 |
1152 | 1151 |
1153 stmnt = conn.prepareStatement(SQL_COLLECTIONS_INSERT); | 1152 stmnt = conn.prepareStatement(SQL_COLLECTIONS_INSERT); |
1154 | 1153 |
1155 stmnt.setInt(1, id); | 1154 stmnt.setInt(1, id); |
1156 stmnt.setString(2, identifier); | 1155 stmnt.setString(2, identifier); |
1157 stmnt.setInt(3, ownerId); | 1156 stmnt.setString(3, name); |
1158 stmnt.setString(4, name); | 1157 stmnt.setInt(4, ownerId); |
1159 | 1158 |
1160 // XXX: A bit odd: we don't have a collection, yet. | 1159 // XXX: A bit odd: we don't have a collection, yet. |
1161 Long ttl = factory.timeToLiveUntouched(null, context); | 1160 Long ttl = factory.timeToLiveUntouched(null, context); |
1162 | 1161 |
1163 if (ttl == null) { | 1162 if (ttl == null) { |