activerecord-jdbcas400-adapter 1.3.7 → 1.3.9
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.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/lib/arjdbc/as400/adapter.rb +5 -16
- data/test/test_adapter.rb +4 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa4ffdd7241e533ca058a550299fd74f7540045b
|
4
|
+
data.tar.gz: 8054ecb61e7a29c63172fdc4a70c88fd015511d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab3ca543c1912dcc6faeb0314cbd29e28ce987abcfd129a0fd8a34952e11b76ee01d233fae61487e445eace73b521a86fcd778b4c7a8b2511f0de324f8cf8685
|
7
|
+
data.tar.gz: fe598ce868542fab9e3d016040c882163eacb12fc6b6ef57e3d2c3bc9e57801b54a532cc410182ab73db8fa916239334810e69bad8e27b28356e7d52cbca8a03
|
data/README.md
CHANGED
@@ -63,6 +63,24 @@ To use native DB2 connection (directly on IBM i JVM only), you can add this to d
|
|
63
63
|
```
|
64
64
|
This connection doesn't require credentials.
|
65
65
|
|
66
|
+
### Transaction isolation : no commit
|
67
|
+
If your database supports setting the isolation level for a transaction, you can set it like so:
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
Post.transaction(isolation: :no_commit) do
|
71
|
+
#...
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
Valid isolation levels are:
|
76
|
+
```
|
77
|
+
:read_uncommitted
|
78
|
+
:read_committed
|
79
|
+
:repeatable_read
|
80
|
+
:serializable
|
81
|
+
:no_commit
|
82
|
+
```
|
83
|
+
|
66
84
|
## Experimental features
|
67
85
|
### Current library
|
68
86
|
To allow migrations with system naming, a configuration is added to adapter:
|
data/lib/arjdbc/as400/adapter.rb
CHANGED
@@ -73,7 +73,7 @@ module ArJdbc
|
|
73
73
|
def rename_column(table_name, column_name, new_column_name)
|
74
74
|
column = columns(table_name, column_name).find { |column| column.name == column_name.to_s}
|
75
75
|
add_column(table_name, new_column_name, column.type, column.instance_values)
|
76
|
-
execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(new_column_name)} = #{quote_column_name(column_name)}")
|
76
|
+
execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(new_column_name)} = #{quote_column_name(column_name)} WITH NC")
|
77
77
|
remove_column(table_name, column_name)
|
78
78
|
end
|
79
79
|
|
@@ -93,24 +93,13 @@ module ArJdbc
|
|
93
93
|
end
|
94
94
|
|
95
95
|
# Disable transactions when they are not supported
|
96
|
-
def
|
97
|
-
super
|
98
|
-
end
|
99
|
-
|
100
|
-
def commit_db_transaction
|
101
|
-
super unless config[:transaction_isolation] == 'none'
|
102
|
-
end
|
103
|
-
|
104
|
-
def rollback_db_transaction
|
105
|
-
super unless config[:transaction_isolation] == 'none'
|
96
|
+
def transaction_isolation_levels
|
97
|
+
super.merge({ no_commit: 'NO COMMIT' })
|
106
98
|
end
|
107
99
|
|
108
100
|
def begin_isolated_db_transaction(isolation)
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
def create_savepoint(name = current_savepoint_name(true))
|
113
|
-
super unless config[:transaction_isolation] == 'none'
|
101
|
+
begin_db_transaction
|
102
|
+
execute "SET TRANSACTION ISOLATION LEVEL #{transaction_isolation_levels.fetch(isolation)}"
|
114
103
|
end
|
115
104
|
|
116
105
|
private
|
data/test/test_adapter.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-jdbcas400-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sieger, Ola Bini, Pierrick Rouxel and JRuby contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-jdbc-adapter
|
@@ -16,12 +16,12 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.3.
|
19
|
+
version: 1.3.9
|
20
20
|
requirement: !ruby/object:Gem::Requirement
|
21
21
|
requirements:
|
22
22
|
- - '>='
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 1.3.
|
24
|
+
version: 1.3.9
|
25
25
|
prerelease: false
|
26
26
|
type: :runtime
|
27
27
|
- !ruby/object:Gem::Dependency
|