|
18 | 18 | import org.apache.commons.lang3.StringUtils; |
19 | 19 | import org.apache.log4j.Logger; |
20 | 20 | import org.jetbrains.annotations.Nullable; |
| 21 | +import org.labkey.api.assay.AssayProvider; |
| 22 | +import org.labkey.api.assay.AssayService; |
21 | 23 | import org.labkey.api.collections.CaseInsensitiveHashMap; |
22 | 24 | import org.labkey.api.collections.CaseInsensitiveHashSet; |
23 | 25 | import org.labkey.api.data.Aggregate; |
|
50 | 52 | import org.labkey.api.query.QueryUpdateServiceException; |
51 | 53 | import org.labkey.api.query.UserSchema; |
52 | 54 | import org.labkey.api.security.User; |
53 | | -import org.labkey.api.assay.AssayProvider; |
54 | | -import org.labkey.api.assay.AssayService; |
55 | 55 | import org.labkey.api.util.PageFlowUtil; |
56 | | -import org.labkey.api.util.ResultSetUtil; |
57 | 56 | import org.labkey.api.view.Portal; |
58 | 57 | import org.labkey.laboratory.query.ContainerIncrementingTable; |
59 | 58 | import org.labkey.laboratory.query.LaboratoryWorkbooksTable; |
@@ -529,19 +528,14 @@ private void processIndexes(DbSchema schema, TableInfo realTable, List<List<Stri |
529 | 528 |
|
530 | 529 | Set<String> indexNames = new CaseInsensitiveHashSet(); |
531 | 530 | DatabaseMetaData meta = schema.getScope().getConnection().getMetaData(); |
532 | | - ResultSet rs = null; |
533 | | - try |
| 531 | + |
| 532 | + try (ResultSet rs = meta.getIndexInfo(schema.getScope().getDatabaseName(), schema.getName(), realTable.getName(), false, false)) |
534 | 533 | { |
535 | | - rs = meta.getIndexInfo(schema.getScope().getDatabaseName(), schema.getName(), realTable.getName(), false, false); |
536 | 534 | while (rs.next()) |
537 | 535 | { |
538 | 536 | indexNames.add(rs.getString("INDEX_NAME")); |
539 | 537 | } |
540 | 538 | } |
541 | | - finally |
542 | | - { |
543 | | - ResultSetUtil.close(rs); |
544 | | - } |
545 | 539 |
|
546 | 540 | boolean exists = indexNames.contains(indexName); |
547 | 541 | if (exists && rebuildIndexes) |
|
0 commit comments