embulk-output-jdbc 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5877712dd337106e3928db69f246a063321562d
4
- data.tar.gz: e6e9a16aa068c522973c6ccf7fa1cc89c0db9ede
3
+ metadata.gz: d3891c0b994ce34234e7b90ded03dacf56fc9f66
4
+ data.tar.gz: 3cda1683bbdad0cab85467765be2a0c16c03b31d
5
5
  SHA512:
6
- metadata.gz: 13b92d80b1891edcb29403b31f018a0b03ca8db6dcd68178bf546210c63dae78e343491badbdb9e1f5ea67df0baad5ef52c9dd64359058d4161478261d041564
7
- data.tar.gz: 51f4aa60573aaad649cee37f98945c44c394f988db0176d592872a2e006235a9cbae1605239cbc0e2e1f3b1f4bc69a5584483e0b26ccc79136a6f2477cd61087
6
+ metadata.gz: e6f380f77d762d8cf2f26a370ab883637a1179831d099b492374b297a0e95f52947faf0ce010fdf6073f9a2b71eefee73f3b7153ed6e4a23de04dad67d2dd0b8
7
+ data.tar.gz: b5f508e16456ad41f61c192d6ee0a5790685c116c2a4803cea7abb8a575981113fb8341af47906fe49d0044e9a300dcfe9aab8f9297eb29b8abe7d61ad20c447
@@ -144,13 +144,23 @@ public class JdbcOutputConnection
144
144
  executeUpdate(stmt, sql);
145
145
  commitIfNecessary(connection);
146
146
  } catch (SQLException ex) {
147
- throw safeRollback(connection, ex);
147
+ // another client might create the table at the same time.
148
+ if (!tableExists(table)) {
149
+ throw safeRollback(connection, ex);
150
+ }
148
151
  } finally {
149
152
  stmt.close();
150
153
  }
151
154
  } else {
152
155
  if (!tableExists(table)) {
153
- createTable(table, schema, tableConstraint, tableOption);
156
+ try {
157
+ createTable(table, schema, tableConstraint, tableOption);
158
+ } catch (SQLException e) {
159
+ // another client might create the table at the same time.
160
+ if (!tableExists(table)) {
161
+ throw e;
162
+ }
163
+ }
154
164
  }
155
165
  }
156
166
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-16 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -19,7 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - build.gradle
22
- - classpath/embulk-output-jdbc-0.8.1.jar
22
+ - classpath/embulk-output-jdbc-0.8.2.jar
23
23
  - lib/embulk/output/jdbc.rb
24
24
  - src/main/java/org/embulk/output/JdbcOutputPlugin.java
25
25
  - src/main/java/org/embulk/output/jdbc/AbstractJdbcOutputPlugin.java