trinidad_generic_dbpool_extension 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,13 @@
1
+ == 0.5.0 (2013-06-28)
2
+
3
+ * updated tomcat-dbcp.jar to 7.0.41 ... due recent fixes in 7.0.39 / 7.0.40 :
4
+ - major statement leak https://issues.apache.org/bugzilla/show_bug.cgi?id=54732
5
+ * no longer bundling driver jars instead depending on jdbc-xxx gems :
6
+ - trinidad_mysql_dbpool_extension -> jdbc-mysql
7
+ - trinidad_postgresql_dbpool_extension - jdbc-postgres
8
+ - trinidad_sqlite_dbpool_extension - jdbc-sqlite3
9
+ - trinidad_mssql_dbpool_extension - jdbc-jtds
10
+
1
11
  == 0.4.2 (2012-12-22)
2
12
 
3
13
  * updated tomcat-dbcp.jar to 7.0.32
@@ -31,7 +41,7 @@
31
41
 
32
42
  == 0.2.0 (2010-07-29)
33
43
 
34
- * Update trinidad_dbpool_extension common gem to support Tomcat 7
44
+ * Update trinidad_dbpool_extension common gem to support Tomcat 7
35
45
 
36
46
  == 0.1.1 (2010-05-05)
37
47
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Team Trinidad and contributors http://github.com/trinidad
1
+ Copyright (c) 2013 Team Trinidad and contributors http://github.com/trinidad
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -21,5 +21,5 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  == JDBC Driver
23
23
 
24
- Included JDBC drivers are most likely distributed under different terms than
24
+ Included JDBC drivers are most likely distributed under different terms than
25
25
  those above, please make sure you understand your driver's license terms.
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Trinidad Database Pool
2
2
 
3
- A bunch of Trinidad extensions to support database connection pooling on top of
3
+ A bunch of Trinidad extensions to support database connection pooling on top of
4
4
  the underlying Apache Tomcat container (using Tomcat's JDBC Connection Pool).
5
5
 
6
- Please note, that such pools are usually configured as "global" and thus
6
+ Please note, that such pools are usually configured as "global" and thus
7
7
  shareable by multiple applications deployed on to of the Trinidad server.
8
8
 
9
9
  Also most Java issues caused by JDBC drivers packaged with the application (e.g.
@@ -18,7 +18,6 @@ http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
18
18
  * PostgreSQL (trinidad_postgresql_dbpool_extension)
19
19
  * SQLite (trinidad_sqlite_dbpool_extension)
20
20
  * MS-SQL (trinidad_mssql_dbpool_extension) using (unofficial) jTDS driver
21
- * Oracle (trinidad_oracle_dbpool_extension)
22
21
  * Generic (trinidad_generic_dbpool_extension) in case your DB ain't supported
23
22
 
24
23
  ## Usage
@@ -41,7 +40,7 @@ http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
41
40
  ```
42
41
 
43
42
  **jndi**, **url** are mandatory (as well **username** and **password** if your
44
- database server + driver requires authentication), while other supported
43
+ database server + driver requires authentication), while other supported
45
44
  configuration options might be found here in Tomcat's "datasource" how-to:
46
45
 
47
46
  http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html
@@ -72,11 +71,11 @@ do not forget to delete **pool** setup part since there's no need for it ...
72
71
 
73
72
  ## Generic Pool
74
73
 
75
- If there's no "official" pool for your database, or would like to use a
74
+ If there's no "official" pool for your database, or would like to use a
76
75
  different version of a JDBC driver for a supported Trinidad pool, this allows
77
76
  you to completely customize a pool.
78
77
 
79
- NOTE: You will need a JDBC driver for your database, check the driver DB if
78
+ NOTE: You will need a JDBC driver for your database, check the driver DB if
80
79
  unsure about how to get one http://developers.sun.com/product/jdbc/drivers
81
80
 
82
81
  Sample configuration for a DB2 database :
@@ -96,13 +95,13 @@ Sample configuration for a DB2 database :
96
95
  Beyond standard configuration options there's 2 specific options here :
97
96
 
98
97
  * **driverPath** should be a path to your JDBC driver archive, might leave that
99
- out but make sure it's on the (shared) class-path for each and every deployed
100
- application that requires it. You might specify multiple jars using the
98
+ out but make sure it's on the (shared) class-path for each and every deployed
99
+ application that requires it. You might specify multiple jars using the
101
100
  `Dir.glob` syntax or by separating paths using the `:` separator.
102
101
 
103
102
  Also in case *driverPath* is omitted you'll need to specify a *driverName* !
104
103
 
105
- * **driverName** the class name implementing the JDBC driver interface, if
104
+ * **driverName** the class name implementing the JDBC driver interface, if
106
105
  you're not sure check the .jar for a META-INF/services/java.sql.Driver file.
107
106
  If present that file contains the class-name and you might leave *driverName*
108
107
  blank if you specified the jar path using *driverPath* but you're going still
@@ -110,5 +109,5 @@ Beyond standard configuration options there's 2 specific options here :
110
109
 
111
110
  ## Copyright
112
111
 
113
- Copyright (c) 2012 [Team Trinidad](https://github.com/trinidad).
112
+ Copyright (c) 2013 [Team Trinidad](https://github.com/trinidad).
114
113
  See LICENSE (http://en.wikipedia.org/wiki/MIT_License) for details.
@@ -1,14 +1,16 @@
1
1
  module Trinidad
2
2
  module Extensions
3
3
  class GenericDbpoolWebAppExtension < DbpoolWebAppExtension
4
-
4
+
5
+ PATH_SEPARATOR = java.io.File::pathSeparator
6
+
5
7
  def driver_path(first = nil)
6
8
  path = @driver_path || []
7
9
  first ? path.first : path
8
10
  end
9
-
11
+
10
12
  def driver_path=(path)
11
- path = ( path || '' ).split(':') # : PATH separator
13
+ path = ( path || '' ).split(PATH_SEPARATOR)
12
14
  path.map! do |jar|
13
15
  jars = Dir.glob(jar)
14
16
  if jars.empty? # normalize .jar ext
@@ -21,7 +23,7 @@ module Trinidad
21
23
  path.flatten!
22
24
  @driver_path = path
23
25
  end
24
-
26
+
25
27
  def driver_name
26
28
  return @driver_name if defined? @driver_name
27
29
  driver_path.find do |path|
@@ -42,24 +44,22 @@ module Trinidad
42
44
  def protocol
43
45
  'jdbc:'
44
46
  end
45
-
47
+
46
48
  protected
47
-
49
+
48
50
  def create_resource tomcat, app_context, options
49
51
  path = options.delete(:driverPath) || options.delete(:driver_path)
50
52
  self.driver_path = path if path
51
53
  if path && driver_path.empty?
52
54
  warn "no driver matched with specified :driverPath = #{path.inspect}"
53
- else
54
- load_driver
55
55
  end
56
56
  super
57
57
  end
58
-
58
+
59
59
  def load_driver
60
60
  driver_path.each { |jar| load jar }
61
61
  end
62
-
62
+
63
63
  end
64
64
  end
65
- end
65
+ end
metadata CHANGED
@@ -1,95 +1,109 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: trinidad_generic_dbpool_extension
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.4.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ prerelease:
6
6
  platform: ruby
7
- authors:
8
- - Patrick Cheng
9
- - Karol Bucek
10
- autorequire:
7
+ authors:
8
+ - Patrick Cheng
9
+ - Karol Bucek
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2012-12-22 00:00:00 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: trinidad_dbpool
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: 0.4.0
25
- type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
31
- none: false
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: "2.10"
36
- type: :development
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: mocha
40
- prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: "0.10"
47
- type: :development
48
- version_requirements: *id003
13
+ date: 2013-06-28 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: trinidad_dbpool
17
+ version_requirements: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.5.0
22
+ none: false
23
+ requirement: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.5.0
28
+ none: false
29
+ prerelease: false
30
+ type: :runtime
31
+ - !ruby/object:Gem::Dependency
32
+ name: rspec
33
+ version_requirements: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '2.10'
38
+ none: false
39
+ requirement: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '2.10'
44
+ none: false
45
+ prerelease: false
46
+ type: :development
47
+ - !ruby/object:Gem::Dependency
48
+ name: mocha
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0.10'
54
+ none: false
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0.10'
60
+ none: false
61
+ prerelease: false
62
+ type: :development
49
63
  description: Addon to support generic database pools in Trinidad
50
- email:
51
- - patrickyccheng@gmail.com
52
- - self@kares.org
64
+ email:
65
+ - patrickyccheng@gmail.com
66
+ - self@kares.org
53
67
  executables: []
54
-
55
68
  extensions: []
56
-
57
- extra_rdoc_files:
58
- - README.md
59
- - History.txt
60
- - LICENSE
61
- files:
62
- - lib/trinidad_generic_dbpool_extension.rb
63
- - lib/trinidad_generic_dbpool_extension/generic_webapp_extension.rb
64
- - README.md
65
- - History.txt
66
- - LICENSE
69
+ extra_rdoc_files:
70
+ - README.md
71
+ - History.txt
72
+ - LICENSE
73
+ files:
74
+ - lib/trinidad_generic_dbpool_extension.rb
75
+ - lib/trinidad_generic_dbpool_extension/generic_webapp_extension.rb
76
+ - README.md
77
+ - History.txt
78
+ - LICENSE
67
79
  homepage: http://github.com/trinidad/trinidad_dbpool_extension
68
80
  licenses: []
69
-
70
- post_install_message:
81
+ post_install_message:
71
82
  rdoc_options: []
72
-
73
- require_paths:
74
- - lib
75
- required_ruby_version: !ruby/object:Gem::Requirement
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ segments:
90
+ - 0
91
+ version: '0'
92
+ hash: 2
76
93
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: "0"
81
- required_rubygems_version: !ruby/object:Gem::Requirement
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - '>='
97
+ - !ruby/object:Gem::Version
98
+ segments:
99
+ - 0
100
+ version: '0'
101
+ hash: 2
82
102
  none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: "0"
87
103
  requirements: []
88
-
89
- rubyforge_project:
104
+ rubyforge_project:
90
105
  rubygems_version: 1.8.24
91
- signing_key:
106
+ signing_key:
92
107
  specification_version: 3
93
108
  summary: Addon to support generic database pools in Trinidad
94
109
  test_files: []
95
-