torquebox-transactions 2.0.1 → 2.0.2

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.
@@ -15,7 +15,12 @@
15
15
  # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16
16
  # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
17
17
 
18
- require 'arjdbc'
18
+ begin
19
+ require 'arjdbc'
20
+ TORQUEBOX_XA_JDBC = true
21
+ rescue LoadError
22
+ TORQUEBOX_XA_JDBC = false
23
+ end
19
24
  require 'set'
20
25
 
21
26
  module TorqueBox
@@ -27,15 +32,17 @@ module TorqueBox
27
32
 
28
33
  module Connection
29
34
 
30
- def transaction(*)
31
- super
32
- rescue ActiveRecord::JDBCError => e
33
- unless self.is_a?(XAResource)
34
- puts "Creating an XAResource; exception=#{e}"
35
- self.extend(XAResource)
36
- retry
37
- else
38
- raise
35
+ if TORQUEBOX_XA_JDBC
36
+ def transaction(*)
37
+ super
38
+ rescue ActiveRecord::JDBCError => e
39
+ unless self.is_a?(XAResource)
40
+ puts "Creating an XAResource; exception=#{e}"
41
+ self.extend(XAResource)
42
+ retry
43
+ else
44
+ raise
45
+ end
39
46
  end
40
47
  end
41
48
 
@@ -114,14 +121,16 @@ module TorqueBox
114
121
  end
115
122
  end
116
123
 
117
- module ActiveRecord
118
- module ConnectionAdapters
119
- class JdbcAdapter
120
- include TorqueBox::Transactions::ActiveRecordAdapters::Connection
124
+ if TORQUEBOX_XA_JDBC
125
+ module ActiveRecord
126
+ module ConnectionAdapters
127
+ class JdbcAdapter
128
+ include TorqueBox::Transactions::ActiveRecordAdapters::Connection
129
+ end
121
130
  end
122
131
  end
123
132
  end
124
-
133
+
125
134
  module TorqueBox
126
135
  module Transactions
127
136
  class Manager
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: torquebox-transactions
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.1
5
+ version: 2.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - The TorqueBox Team
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-04-16 00:00:00 Z
13
+ date: 2012-05-01 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: torquebox-core
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.1
23
+ version: 2.0.2
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
@@ -45,8 +45,8 @@ extra_rdoc_files: []
45
45
 
46
46
  files:
47
47
  - licenses/lgpl-2.1.txt
48
- - lib/torquebox/transactions.rb
49
48
  - lib/torquebox/active_record_adapters.rb
49
+ - lib/torquebox/transactions.rb
50
50
  - lib/torquebox/transactions/ext/active_record/base.rb
51
51
  homepage: http://torquebox.org/
52
52
  licenses: