jdbc-helper 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jdbc-helper/connection.rb +3 -1
- data/test/test_object_wrapper.rb +25 -0
- metadata +123 -130
@@ -181,6 +181,8 @@ class Connection
|
|
181
181
|
@prev_stat = Stat.new(nil, 0, 0, 0)
|
182
182
|
|
183
183
|
@pstmts = []
|
184
|
+
|
185
|
+
@table_wrappers = {}
|
184
186
|
|
185
187
|
if block_given?
|
186
188
|
begin
|
@@ -397,7 +399,7 @@ class Connection
|
|
397
399
|
# @param [String/Symbol] table_name Name of the table to be wrapped
|
398
400
|
# @return [JDBCHelper::TableWrapper]
|
399
401
|
def table table_name
|
400
|
-
|
402
|
+
@table_wrappers[table_name] ||= JDBCHelper::TableWrapper.new self, table_name
|
401
403
|
end
|
402
404
|
|
403
405
|
# Returns a sequence wrapper for the given name
|
data/test/test_object_wrapper.rb
CHANGED
@@ -433,6 +433,31 @@ class TestObjectWrapper < Test::Unit::TestCase
|
|
433
433
|
end
|
434
434
|
end
|
435
435
|
|
436
|
+
# 0.5.1: Too many open cursors
|
437
|
+
def test_ora_10000
|
438
|
+
each_connection do |conn|
|
439
|
+
create_table conn
|
440
|
+
insert conn.table(@table_name)
|
441
|
+
|
442
|
+
# Batch-enabled object
|
443
|
+
conn.table(@table_name).batch
|
444
|
+
|
445
|
+
10000.times do
|
446
|
+
# Should not fail
|
447
|
+
t = conn.table(@table_name)
|
448
|
+
t.count(:id => 1)
|
449
|
+
|
450
|
+
assert_equal false, t.batch?
|
451
|
+
t2 = t.batch
|
452
|
+
assert_equal false, t.batch?
|
453
|
+
assert_equal true, t2.batch?
|
454
|
+
end
|
455
|
+
|
456
|
+
# OK
|
457
|
+
assert true
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
436
461
|
def test_prepared_statements
|
437
462
|
each_connection do |conn|
|
438
463
|
create_table conn
|
metadata
CHANGED
@@ -1,150 +1,143 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jdbc-helper
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.1
|
4
5
|
prerelease:
|
5
|
-
version: 0.5.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
|
7
|
+
authors:
|
8
|
+
- Junegunn Choi
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
prerelease: false
|
70
|
-
type: :development
|
12
|
+
date: 2011-08-29 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: &2152937260 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.0.0
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2152937260
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: jeweler
|
27
|
+
requirement: &2152936680 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.5.2
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2152936680
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rcov
|
38
|
+
requirement: &2152936120 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *2152936120
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: test-unit
|
49
|
+
requirement: &2152935620 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.3.0
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *2152935620
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: pry
|
60
|
+
requirement: &2152935120 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *2152935120
|
71
69
|
description: A JDBC helper for JRuby/Database developers.
|
72
70
|
email: junegunn.c@gmail.com
|
73
71
|
executables: []
|
74
|
-
|
75
72
|
extensions: []
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
- test/test_sql.rb
|
111
|
-
has_rdoc: true
|
73
|
+
extra_rdoc_files:
|
74
|
+
- LICENSE.txt
|
75
|
+
- README.rdoc
|
76
|
+
files:
|
77
|
+
- lib/jdbc-helper.rb
|
78
|
+
- lib/jdbc-helper/connection.rb
|
79
|
+
- lib/jdbc-helper/connection/callable_statement.rb
|
80
|
+
- lib/jdbc-helper/connection/parameterized_statement.rb
|
81
|
+
- lib/jdbc-helper/connection/prepared_statement.rb
|
82
|
+
- lib/jdbc-helper/connection/result_set_enumerator.rb
|
83
|
+
- lib/jdbc-helper/connection/row.rb
|
84
|
+
- lib/jdbc-helper/connection/statement_pool.rb
|
85
|
+
- lib/jdbc-helper/connection/type_map.rb
|
86
|
+
- lib/jdbc-helper/connector.rb
|
87
|
+
- lib/jdbc-helper/connector/mysql_connector.rb
|
88
|
+
- lib/jdbc-helper/connector/oracle_connector.rb
|
89
|
+
- lib/jdbc-helper/constants.rb
|
90
|
+
- lib/jdbc-helper/sql.rb
|
91
|
+
- lib/jdbc-helper/sql_prepared.rb
|
92
|
+
- lib/jdbc-helper/wrapper/function_wrapper.rb
|
93
|
+
- lib/jdbc-helper/wrapper/object_wrapper.rb
|
94
|
+
- lib/jdbc-helper/wrapper/procedure_wrapper.rb
|
95
|
+
- lib/jdbc-helper/wrapper/sequence_wrapper.rb
|
96
|
+
- lib/jdbc-helper/wrapper/table_wrapper.rb
|
97
|
+
- LICENSE.txt
|
98
|
+
- README.rdoc
|
99
|
+
- test/database.yml
|
100
|
+
- test/database.yml.org
|
101
|
+
- test/helper.rb
|
102
|
+
- test/test_connection.rb
|
103
|
+
- test/test_connectors.rb
|
104
|
+
- test/test_object_wrapper.rb
|
105
|
+
- test/test_performance.rb
|
106
|
+
- test/test_sql.rb
|
112
107
|
homepage: http://github.com/junegunn/jdbc-helper
|
113
|
-
licenses:
|
114
|
-
|
108
|
+
licenses:
|
109
|
+
- MIT
|
115
110
|
post_install_message:
|
116
111
|
rdoc_options: []
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
115
|
none: false
|
122
|
-
requirements:
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
hash: -4015855572865815937
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
124
|
none: false
|
131
|
-
requirements:
|
132
|
-
|
133
|
-
|
134
|
-
|
125
|
+
requirements:
|
126
|
+
- - ! '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
135
129
|
requirements: []
|
136
|
-
|
137
130
|
rubyforge_project:
|
138
|
-
rubygems_version: 1.
|
131
|
+
rubygems_version: 1.8.6
|
139
132
|
signing_key:
|
140
133
|
specification_version: 3
|
141
134
|
summary: A JDBC helper for JRuby/Database developers.
|
142
|
-
test_files:
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
135
|
+
test_files:
|
136
|
+
- test/database.yml
|
137
|
+
- test/database.yml.org
|
138
|
+
- test/helper.rb
|
139
|
+
- test/test_connection.rb
|
140
|
+
- test/test_connectors.rb
|
141
|
+
- test/test_object_wrapper.rb
|
142
|
+
- test/test_performance.rb
|
143
|
+
- test/test_sql.rb
|