activerecord-jdbcnuodb-adapter 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  SHA1:
3
3
  metadata.gz: !binary |-
4
- YjQyNTYyZWU5MjBmN2M5NGVhOWU2ZjVjYmJlY2M4ZjhmZDZhNGM4OQ==
4
+ MWEzZGEzNTljYjZiNTIzZWI5NDkxMmFhMTlhNmU2ODU1Njg0ODhmYQ==
5
5
  data.tar.gz: !binary |-
6
- NGRmZmI2ZmM2ZjBlODY0MmM0ODViYWFlMjdjNjIxNjRmZDc2OGMyNg==
6
+ MTY0NDY4Yzg1YzI1YjA1NGJkZTIzMzA3ODcxYTMxMzI0MWE5YjA4Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjVlMGM1ODc2ODJkZjYxNTg2ZTdmYjdhY2M3YTQwZWRhYzc4MWY5ZjRhYTY1
10
- Zjk5YTk1MDEzNTJlMWI3MjM0NWFmNDNlYjg1OWI0NzZkOTY2YWMzODg3NDlh
11
- YzI4ODk5MTBiNDJhZDI2ZWE2MjZiNDViZWQyYjg0M2MwMjMwZWE=
9
+ MTM1Y2YxMzllNDYwZTRlMWVlN2YzOWQ2NzVjODgxZTQyYTc2MjFkZTkzOGM1
10
+ YWU5NDYwNzM4OWJjODgzMDJiMzMxMGQ2NjlmZGViMGIwODk4Mjg2NTdmZTg0
11
+ NDY3NGE5ZTA5NTdiOGE2NTBhYjUzMDlhZDNlNmEzN2RmNmYxMTU=
12
12
  data.tar.gz: !binary |-
13
- ZWQ4ZDNjMTJhN2U2YWU2NDI2MTAwNmExYjFkMDA4YjkxYWRlMjU1MWNkMWFk
14
- MWM2YmU1OTI4YmM5MWZiZmVjZWY4ZjJjMjU4YmM3N2E0MDlhZTQ2MTc4OTMx
15
- MzNjNjBlNGUzMWQ4NTcyNzMwOGY0MmQzNjA1YjNjNDI5MzhlMjI=
13
+ OGFjMTUxODYyN2RiNzgxMGEyMmJiOWZjMTc1NTNlMGIwNWE2Mjg0MzFiODRl
14
+ NjJjM2Y2Y2VhOWI1NDQ4ZDg5NmE3NTU5N2U2MTNmMDU2MDI1YjE4YmVmNjBk
15
+ MWIwNjBiMWE0ODFkNGRkY2MyNDcxZjc4OTg0Nzk0MDBkMjYyNDI=
data/README.rdoc CHANGED
@@ -138,11 +138,11 @@ To compile and test run this command:
138
138
 
139
139
  == INSTALLING THE GEM
140
140
 
141
- jruby -S gem install activerecord-jdbcnuodb-adapter-1.0.2.gem
141
+ jruby -S gem install activerecord-jdbcnuodb-adapter-1.0.3.gem
142
142
 
143
143
  Or from the source tree:
144
144
 
145
- jruby -S gem install pkg/activerecord-jdbcnuodb-adapter-1.0.2.gem
145
+ jruby -S gem install pkg/activerecord-jdbcnuodb-adapter-1.0.3.gem
146
146
 
147
147
  == TESTING THE GEM
148
148
 
@@ -169,7 +169,7 @@ Run the tests:
169
169
 
170
170
  jruby -S gem install rails
171
171
  jruby -S gem install jdbc-nuodb-1.0.1.gem
172
- jruby -S gem install activerecord-jdbcnuodb-adapter-1.0.2.gem
172
+ jruby -S gem install activerecord-jdbcnuodb-adapter-1.0.3.gem
173
173
 
174
174
  2. Verify the gems are installed:
175
175
 
@@ -186,26 +186,26 @@ Run the tests:
186
186
 
187
187
  Tag the product using tags per the SemVer specification; our tags have a v-prefix:
188
188
 
189
- git tag -a v1.0.2 -m "SemVer Version: v1.0.2"
189
+ git tag -a v1.0.3 -m "SemVer Version: v1.0.3"
190
190
  git push --tags
191
191
 
192
192
  If you make a mistake, take it back quickly:
193
193
 
194
- git tag -d v1.0.2
195
- git push origin :refs/tags/v1.0.2
194
+ git tag -d v1.0.3
195
+ git push origin :refs/tags/v1.0.3
196
196
 
197
197
  ===PUBLISHING
198
198
 
199
199
  Here are the commands used to publish:
200
200
 
201
- gem push pkg/activerecord-jdbcnuodb-adapter-1.0.2.gem
201
+ gem push pkg/activerecord-jdbcnuodb-adapter-1.0.3.gem
202
202
 
203
203
  == INSPECTING THE GEM
204
204
 
205
205
  It is often useful to inspect the contents of a Gem before distribution.
206
206
  To do this you dump the contents of a gem thus:
207
207
 
208
- gem unpack pkg/activerecord-jdbcnuodb-adapter-1.0.2.gem
208
+ gem unpack pkg/activerecord-jdbcnuodb-adapter-1.0.3.gem
209
209
 
210
210
  == REFERENCES
211
211
 
data/Rakefile CHANGED
@@ -147,7 +147,7 @@ task :build do
147
147
  end
148
148
 
149
149
  task :install => :build do
150
- sh %{jruby -S gem install pkg/#{name}-#{version}}
150
+ sh %{jruby -S gem install pkg/#{name}-#{version}.gem}
151
151
  end
152
152
 
153
153
  task :uninstall do
@@ -1,5 +1,5 @@
1
1
  module ArJdbc
2
2
  module NuoDB
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
@@ -171,7 +171,18 @@ module ::ArJdbc
171
171
 
172
172
  # SCHEMA STATEMENTS ======================================================
173
173
 
174
+ def tables(name = nil)
175
+ #puts "called columns"
176
+ super
177
+ end
178
+
179
+ def indexes(table_name, name = nil, schema_name = nil)
180
+ #puts "called columns"
181
+ super
182
+ end
183
+
174
184
  def columns(table_name, name=nil)
185
+ #puts "called columns"
175
186
  @connection.columns_internal(table_name.to_s, name, nuodb_schema)
176
187
  end
177
188
 
@@ -240,24 +251,35 @@ module ::ArJdbc
240
251
 
241
252
  # DATABASE STATEMENTS ====================================================
242
253
 
243
- def exec_insert(sql, name, binds)
244
- sql = substitute_binds(sql, binds)
245
- @connection.execute_insert(sql)
246
- end
247
-
248
254
  LOST_CONNECTION_ERROR_MESSAGES = [
249
255
  "End of stream reached",
250
- "Broken pipe"]
256
+ "Broken pipe",
257
+ "Connection reset"
258
+ ]
251
259
 
252
260
  # Monkey patch the execute method as reconnect is broken in the underlying
253
261
  # Rails infrastructure; see these bug numbers and references:
254
262
  #
255
263
  # - https://github.com/jruby/activerecord-jdbc-adapter/issues/232
256
264
  # - https://github.com/jruby/activerecord-jdbc-adapter/issues/237
265
+
257
266
  def execute(sql, name = nil, binds = [])
267
+ tries ||= 2
268
+ super(sql, name, binds)
269
+ rescue ActiveRecord::StatementInvalid, ActiveRecord::JDBCError => exception
270
+ if LOST_CONNECTION_ERROR_MESSAGES.any? { |msg| exception.message =~ /#{msg}/ }
271
+ if open_transactions == 0
272
+ reconnect!
273
+ retry unless (tries -= 1).zero?
274
+ end
275
+ end
276
+ raise
277
+ end
278
+
279
+ def begin_db_transaction
258
280
  tries ||= 2
259
281
  super
260
- rescue ActiveRecord::StatementInvalid => exception
282
+ rescue ActiveRecord::StatementInvalid, ActiveRecord::JDBCError => exception
261
283
  if LOST_CONNECTION_ERROR_MESSAGES.any? { |msg| exception.message =~ /#{msg}/ }
262
284
  reconnect!
263
285
  retry unless (tries -= 1).zero?
@@ -265,6 +287,25 @@ module ::ArJdbc
265
287
  raise
266
288
  end
267
289
 
290
+ def commit_db_transaction
291
+ super
292
+ rescue ActiveRecord::StatementInvalid, ActiveRecord::JDBCError => exception
293
+ if LOST_CONNECTION_ERROR_MESSAGES.any? { |msg| exception.message =~ /#{msg}/ }
294
+ reconnect!
295
+ end
296
+ raise
297
+ end
298
+
299
+ def rollback_db_transaction
300
+ super
301
+ rescue ActiveRecord::StatementInvalid, ActiveRecord::JDBCError => exception
302
+ if LOST_CONNECTION_ERROR_MESSAGES.any? { |msg| exception.message =~ /#{msg}/ }
303
+ reconnect!
304
+ else
305
+ raise
306
+ end
307
+ end
308
+
268
309
  # CONNECTION POOL ========================================================
269
310
 
270
311
  def primary_keys(table)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbcnuodb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Buck
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-17 00:00:00.000000000 Z
12
+ date: 2013-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jdbc-nuodb