FooComponent: check before create
Change-Id: Ie073ebc41a4c9028a1db804c57047a95f6617e47
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -157,7 +157,9 @@ public class FooComponent { | ... | @@ -157,7 +157,9 @@ public class FooComponent { |
157 | final String someTable = "admin"; | 157 | final String someTable = "admin"; |
158 | final String someKey = "long"; | 158 | final String someKey = "long"; |
159 | 159 | ||
160 | - dbAdminService.createTable(someTable); | 160 | + if (!dbAdminService.listTables().contains(someTable)) { |
161 | + dbAdminService.createTable(someTable); | ||
162 | + } | ||
161 | 163 | ||
162 | VersionedValue vv = dbService.get(someTable, someKey); | 164 | VersionedValue vv = dbService.get(someTable, someKey); |
163 | if (vv == null) { | 165 | if (vv == null) { | ... | ... |
-
Please register or login to post a comment