trinidad_dbpool 0.4.3 → 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.
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ task :clear do
19
19
  end
20
20
  task :clean => :clear
21
21
 
22
- all_gems = %W{
22
+ all_gems = %W{
23
23
  dbpool
24
24
  generic_dbpool_extension
25
25
  mysql_dbpool_extension
@@ -30,14 +30,14 @@ all_gems = %W{
30
30
  }.map { |gem| "trinidad_#{gem}" }
31
31
 
32
32
  all_gems.each do |gem_name|
33
-
33
+
34
34
  gem_helper = Bundler::GemHelper.new(Dir.pwd, gem_name)
35
35
  def gem_helper.version_tag
36
36
  "#{name}-#{version}" # override "v#{version}"
37
37
  end
38
38
  version = gem_helper.send(:version)
39
39
  version_tag = gem_helper.version_tag
40
-
40
+
41
41
  namespace gem_name do
42
42
  desc "Build #{gem_name}-#{version}.gem into the pkg directory"
43
43
  task('build') { gem_helper.build_gem }
@@ -48,7 +48,7 @@ all_gems.each do |gem_name|
48
48
  desc "Create tag #{version_tag} and build and push #{gem_name}-#{version}.gem to Rubygems"
49
49
  task('release') { gem_helper.release_gem }
50
50
  end
51
-
51
+
52
52
  end
53
53
 
54
54
  namespace :all do
@@ -60,18 +60,18 @@ namespace :all do
60
60
  end
61
61
 
62
62
  namespace :'tomcat-dbcp' do
63
-
63
+
64
64
  TOMCAT_MAVEN_REPO = 'http://repo2.maven.org/maven2/org/apache/tomcat'
65
65
 
66
66
  TRINIDAD_LIBS = File.expand_path('./trinidad-libs', File.dirname(__FILE__))
67
67
 
68
68
  dbcp_jar = "tomcat-dbcp.jar"
69
-
70
- task :download, :version do |_, args|
71
- version = [ args[:version] ]
72
-
69
+
70
+ task :download, :version do |_, args| # rake tomcat-dbcp:download[7.0.41]
71
+ version = args[:version]
72
+
73
73
  dbcp_uri = "#{TOMCAT_MAVEN_REPO}/tomcat-dbcp/#{version}/tomcat-dbcp-#{version}.jar"
74
-
74
+
75
75
  require 'open-uri'; require 'tmpdir'
76
76
 
77
77
  temp_dir = File.join(Dir.tmpdir, (Time.now.to_f * 1000).to_i.to_s)
@@ -91,7 +91,7 @@ namespace :'tomcat-dbcp' do
91
91
 
92
92
  FileUtils.rm_r temp_dir
93
93
  end
94
-
94
+
95
95
  task :check do
96
96
  jar_path = File.join(TRINIDAD_LIBS, dbcp_jar)
97
97
  unless File.exist?(jar_path)
@@ -1,6 +1,7 @@
1
1
  module Trinidad
2
2
  module Extensions
3
3
  class DbpoolWebAppExtension < WebAppExtension
4
+
4
5
  def configure(tomcat, app_context)
5
6
  case @options
6
7
  when Hash
@@ -9,18 +10,21 @@ module Trinidad
9
10
  @options.map { |opts| create_resource tomcat, app_context, opts }
10
11
  end
11
12
  end
12
-
13
+
13
14
  protected
15
+
14
16
  def create_resource tomcat, app_context, options
15
17
  jndi, url = options.delete(:jndi), options.delete(:url)
16
18
  url = protocol + url unless %r{^#{protocol}} =~ url
17
19
  options[:url] = url
18
-
19
- driver_name = options.delete(:driver) || options.delete(:driverName) ||
20
+
21
+ load_driver
22
+
23
+ driver_name = options.delete(:driver) || options.delete(:driverName) ||
20
24
  self.driver_name
21
-
22
- # <Resource name="jdbc/MyDB"
23
- # auth="Container"
25
+
26
+ # <Resource name="jdbc/MyDB"
27
+ # auth="Container"
24
28
  # type="javax.sql.DataSource"
25
29
  # url="jdbc:mysql://localhost:3306/mydb"
26
30
  # driverClassName="com.mysql.jdbc.Driver"
@@ -40,6 +44,9 @@ module Trinidad
40
44
 
41
45
  resource
42
46
  end
47
+
48
+ def load_driver; end
49
+
43
50
  end
44
51
  end
45
- end
52
+ end
Binary file
metadata CHANGED
@@ -1,101 +1,109 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: trinidad_dbpool
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.4.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ prerelease:
6
6
  platform: ruby
7
- authors:
8
- - David Calavera
9
- autorequire:
7
+ authors:
8
+ - David Calavera
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2013-02-21 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: trinidad_jars
17
- version_requirements: &id001 !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.2.0
23
- requirement: *id001
24
- prerelease: false
25
- type: :runtime
26
- - !ruby/object:Gem::Dependency
27
- name: rspec
28
- version_requirements: &id002 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "2.10"
34
- requirement: *id002
35
- prerelease: false
36
- type: :development
37
- - !ruby/object:Gem::Dependency
38
- name: mocha
39
- version_requirements: &id003 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0.10"
45
- requirement: *id003
46
- prerelease: false
47
- type: :development
12
+ date: 2013-06-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: trinidad_jars
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: 1.2.4
21
+ none: false
22
+ requirement: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.4
27
+ none: false
28
+ prerelease: false
29
+ type: :runtime
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '2.10'
37
+ none: false
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '2.10'
43
+ none: false
44
+ prerelease: false
45
+ type: :development
46
+ - !ruby/object:Gem::Dependency
47
+ name: mocha
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0.10'
53
+ none: false
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0.10'
59
+ none: false
60
+ prerelease: false
61
+ type: :development
48
62
  description: Addon to support database pools in Trinidad
49
63
  email: calavera@apache.org
50
64
  executables: []
51
-
52
65
  extensions: []
53
-
54
- extra_rdoc_files:
55
- - README.md
56
- - History.txt
57
- - LICENSE
58
- - Rakefile
59
- files:
60
- - lib/trinidad_dbpool.rb
61
- - lib/trinidad_dbpool/webapp_extension.rb
62
- - trinidad-libs/tomcat-dbcp.jar
63
- - README.md
64
- - History.txt
65
- - LICENSE
66
- - Rakefile
66
+ extra_rdoc_files:
67
+ - README.md
68
+ - History.txt
69
+ - LICENSE
70
+ - Rakefile
71
+ files:
72
+ - lib/trinidad_dbpool.rb
73
+ - lib/trinidad_dbpool/webapp_extension.rb
74
+ - trinidad-libs/tomcat-dbcp.jar
75
+ - README.md
76
+ - History.txt
77
+ - LICENSE
78
+ - Rakefile
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
- hash: 2
81
- segments:
82
- - 0
83
- version: "0"
84
- 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
85
102
  none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- hash: 2
90
- segments:
91
- - 0
92
- version: "0"
93
103
  requirements: []
94
-
95
- rubyforge_project:
104
+ rubyforge_project:
96
105
  rubygems_version: 1.8.24
97
- signing_key:
106
+ signing_key:
98
107
  specification_version: 3
99
108
  summary: Addon to support database pools in Trinidad
100
109
  test_files: []
101
-