jvertica 0.1.3 → 0.1.4

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: 2e53badf563b438fd973cecd8f00ea5f5b1b861b
4
- data.tar.gz: 3b08867c727faea7c61db337fa7d9eb61780d4a9
3
+ metadata.gz: de9c6674f79eaed12e230662901b1c579f472253
4
+ data.tar.gz: fcfe4c0b86cdab21e1373e89268543b61b4c1b0e
5
5
  SHA512:
6
- metadata.gz: 2c1abbc4d39eeb07c862aadaee532ce6b893fd3cb3d958b5b155c8d9e2e6bd84a3f3000dd2fa95995109ecb4efa349b3b6f88940c49306307f4ab95c3c39b675
7
- data.tar.gz: 6b29d7743b8aa84aec08ec8749cb668cf3e97f4f753b97c9002e96690b50f3a57bba9e2ae9e15ede3674563a502b396e565438fcf46ed769e03a5ddd00547860
6
+ metadata.gz: 6f4a55033585367e0958b96b427be21f572f8481dc7b383bf8385a5975cb7ac881866c004cd77492646055dc344f6436b97f2351fcb3608864af4f39f65b91b9
7
+ data.tar.gz: 30c732927c8a6ce45c55059c93c2b6e5d16522ddd46f068f602d5a46c78ed288fefc1a5f1123a286d98253d1102038e6cd69bba5eb2f40437fd0daa292df1712
@@ -1,3 +1,3 @@
1
1
  class Jvertica
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/jvertica.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'java'
2
+ require 'thread'
2
3
  require 'jvertica/version'
3
4
  require 'jdbc-vertica'
4
5
  require Jdbc::Vertica.driver_jar
@@ -122,15 +123,18 @@ class Jvertica
122
123
  elsif block_given?
123
124
  i, o = IO.pipe
124
125
  begin
125
- yield(o)
126
- o.close
126
+ thread = Thread.new do
127
+ yield(o)
128
+ o.close
129
+ end
127
130
  stream.addStream org.jruby.util.IOInputStream.new(i)
128
131
  rescue => e
129
132
  raise e
130
133
  ensure
134
+ thread.join
131
135
  end
132
-
133
136
  end
137
+
134
138
  rescue => e
135
139
  r = stream.finish
136
140
  raise e.class.new("[affected rows: #{r}] #{e.message}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jvertica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - takahiro.nakayama