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 +8 -8
- data/README.rdoc +8 -8
- data/Rakefile +1 -1
- data/lib/activerecord-jdbcnuodb-adapter.rb +1 -1
- data/lib/arjdbc/nuodb/adapter.rb +48 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWEzZGEzNTljYjZiNTIzZWI5NDkxMmFhMTlhNmU2ODU1Njg0ODhmYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTY0NDY4Yzg1YzI1YjA1NGJkZTIzMzA3ODcxYTMxMzI0MWE5YjA4Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTM1Y2YxMzllNDYwZTRlMWVlN2YzOWQ2NzVjODgxZTQyYTc2MjFkZTkzOGM1
|
10
|
+
YWU5NDYwNzM4OWJjODgzMDJiMzMxMGQ2NjlmZGViMGIwODk4Mjg2NTdmZTg0
|
11
|
+
NDY3NGE5ZTA5NTdiOGE2NTBhYjUzMDlhZDNlNmEzN2RmNmYxMTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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.
|
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.
|
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.
|
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.
|
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.
|
195
|
-
git push origin :refs/tags/v1.0.
|
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.
|
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.
|
208
|
+
gem unpack pkg/activerecord-jdbcnuodb-adapter-1.0.3.gem
|
209
209
|
|
210
210
|
== REFERENCES
|
211
211
|
|
data/Rakefile
CHANGED
data/lib/arjdbc/nuodb/adapter.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jdbc-nuodb
|