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.
@@ -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
- JDBCHelper::TableWrapper.new self, table_name
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
@@ -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
- - Junegunn Choi
7
+ authors:
8
+ - Junegunn Choi
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-29 00:00:00 +09:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: bundler
18
- version_requirements: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ~>
22
- - !ruby/object:Gem::Version
23
- version: 1.0.0
24
- requirement: *id001
25
- prerelease: false
26
- type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: jeweler
29
- version_requirements: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: 1.5.2
35
- requirement: *id002
36
- prerelease: false
37
- type: :development
38
- - !ruby/object:Gem::Dependency
39
- name: rcov
40
- version_requirements: &id003 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
46
- requirement: *id003
47
- prerelease: false
48
- type: :development
49
- - !ruby/object:Gem::Dependency
50
- name: test-unit
51
- version_requirements: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 2.3.0
57
- requirement: *id004
58
- prerelease: false
59
- type: :development
60
- - !ruby/object:Gem::Dependency
61
- name: pry
62
- version_requirements: &id005 !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: "0"
68
- requirement: *id005
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
- extra_rdoc_files:
78
- - LICENSE.txt
79
- - README.rdoc
80
- files:
81
- - lib/jdbc-helper.rb
82
- - lib/jdbc-helper/connection.rb
83
- - lib/jdbc-helper/connection/callable_statement.rb
84
- - lib/jdbc-helper/connection/parameterized_statement.rb
85
- - lib/jdbc-helper/connection/prepared_statement.rb
86
- - lib/jdbc-helper/connection/result_set_enumerator.rb
87
- - lib/jdbc-helper/connection/row.rb
88
- - lib/jdbc-helper/connection/statement_pool.rb
89
- - lib/jdbc-helper/connection/type_map.rb
90
- - lib/jdbc-helper/connector.rb
91
- - lib/jdbc-helper/connector/mysql_connector.rb
92
- - lib/jdbc-helper/connector/oracle_connector.rb
93
- - lib/jdbc-helper/constants.rb
94
- - lib/jdbc-helper/sql.rb
95
- - lib/jdbc-helper/sql_prepared.rb
96
- - lib/jdbc-helper/wrapper/function_wrapper.rb
97
- - lib/jdbc-helper/wrapper/object_wrapper.rb
98
- - lib/jdbc-helper/wrapper/procedure_wrapper.rb
99
- - lib/jdbc-helper/wrapper/sequence_wrapper.rb
100
- - lib/jdbc-helper/wrapper/table_wrapper.rb
101
- - LICENSE.txt
102
- - README.rdoc
103
- - test/database.yml
104
- - test/database.yml.org
105
- - test/helper.rb
106
- - test/test_connection.rb
107
- - test/test_connectors.rb
108
- - test/test_object_wrapper.rb
109
- - test/test_performance.rb
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
- - MIT
108
+ licenses:
109
+ - MIT
115
110
  post_install_message:
116
111
  rdoc_options: []
117
-
118
- require_paths:
119
- - lib
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
- - !ruby/object:Gem::Version
125
- hash: 2
126
- segments:
127
- - 0
128
- version: "0"
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
- - !ruby/object:Gem::Version
134
- version: "0"
125
+ requirements:
126
+ - - ! '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
135
129
  requirements: []
136
-
137
130
  rubyforge_project:
138
- rubygems_version: 1.5.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
- - test/database.yml
144
- - test/database.yml.org
145
- - test/helper.rb
146
- - test/test_connection.rb
147
- - test/test_connectors.rb
148
- - test/test_object_wrapper.rb
149
- - test/test_performance.rb
150
- - test/test_sql.rb
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