traject_horizon 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/traject/horizon_reader.rb +17 -9
- data/lib/traject_horizon/version.rb +1 -1
- metadata +61 -46
- checksums.yaml +0 -7
@@ -210,14 +210,18 @@ module Traject
|
|
210
210
|
EOS
|
211
211
|
|
212
212
|
sql = <<-EOS
|
213
|
-
SELECT b
|
213
|
+
SELECT b.*
|
214
214
|
FROM fullbib b
|
215
|
-
JOIN bib_control bc on b.bib# = bc.bib#
|
216
215
|
WHERE 1 = 1
|
217
216
|
EOS
|
218
217
|
|
218
|
+
# Oddly, Sybase seems to do a lot BETTER when we make this a sub-query
|
219
|
+
# as opposed to a join. Join was resulting in "Can't allocate space for object 'temp worktable' in database 'tempdb'"
|
220
|
+
# from Sybase, but somehow we get away with subquery?
|
221
|
+
#
|
222
|
+
# Note this subquery we managed to not refer to outer scope, that's the key.
|
219
223
|
if settings["horizon.public_only"].to_s == "true"
|
220
|
-
sql
|
224
|
+
sql+= " AND b.bib# NOT IN (SELECT DISTINCT bc.bib# from bib_control bc WHERE bc.staff_only = 1) "
|
221
225
|
end
|
222
226
|
|
223
227
|
# settings should not be coming from untrusted user input not going
|
@@ -231,19 +235,21 @@ module Traject
|
|
231
235
|
sql += " AND " + clauses.join(" AND ") + " "
|
232
236
|
end
|
233
237
|
|
234
|
-
# without the order by, rows
|
235
|
-
#
|
238
|
+
# without the order by, rows come back in mostly the right order,
|
239
|
+
# by bib#, but fairly common do NOT as well.
|
240
|
+
# -- when they don't, it can cause one real
|
236
241
|
# record to be split up into multiple partial output record, which
|
237
242
|
# cna overwrite each other in the solr index.
|
238
243
|
#
|
239
|
-
# So we sort -- which
|
240
|
-
#
|
244
|
+
# So we sort -- which makes query slower, and makes it a lot harder
|
245
|
+
# to avoid Sybase "cannot allocate space" errors, but we've got
|
246
|
+
# no real choice. Ideally we might include 'tagord'
|
241
247
|
# in the sort too, but that seems to make performance even worse,
|
242
248
|
# we're willing to risk tags not being reassembled in exactly the
|
243
249
|
# right order, usually they are anyway, and it doesn't usually matter anyway.
|
244
250
|
sql+= " ORDER BY b.bib# " # ", tagord" would be even better, but slower.
|
245
251
|
|
246
|
-
pstmt = conn.prepareStatement(sql);
|
252
|
+
pstmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
|
247
253
|
|
248
254
|
# this may be what's neccesary to keep the driver from fetching
|
249
255
|
# entire result set into memory.
|
@@ -582,7 +588,7 @@ module Traject
|
|
582
588
|
# It might be higher performance to refactor to re-use the same prepared statement
|
583
589
|
# for each item/copy fetch... but appears to be no great way to do that in JDBC3
|
584
590
|
# where you need to parameterize "IN" values. JDBC4 has got it, but jTDS is just JDBC3.
|
585
|
-
pstmt = conn.prepareStatement(sql);
|
591
|
+
pstmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
|
586
592
|
rs = pstmt.executeQuery
|
587
593
|
|
588
594
|
|
@@ -679,6 +685,8 @@ module Traject
|
|
679
685
|
|
680
686
|
"jdbc:jtds:#{jtds_type}://#{host}:#{port}/#{database};user=#{user}"
|
681
687
|
end
|
688
|
+
# Not sure if useCursors makes a difference, but just in case.
|
689
|
+
url += ";useCursors=true"
|
682
690
|
|
683
691
|
if include_password
|
684
692
|
password = settings['horizon.password'] or raise ArgumentError.new("Need horizon.password setting")
|
metadata
CHANGED
@@ -1,100 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traject_horizon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Jonathan Rochkind
|
8
|
-
autorequire:
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: traject
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
21
18
|
requirements:
|
22
|
-
- - '>='
|
19
|
+
- - ! '>='
|
23
20
|
- !ruby/object:Gem::Version
|
24
21
|
version: '0'
|
25
|
-
prerelease: false
|
26
22
|
type: :runtime
|
27
|
-
|
28
|
-
name: marc-marc4j
|
23
|
+
prerelease: false
|
29
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
30
26
|
requirements:
|
31
|
-
- - '>='
|
27
|
+
- - ! '>='
|
32
28
|
- !ruby/object:Gem::Version
|
33
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: marc-marc4j
|
34
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
35
34
|
requirements:
|
36
|
-
- - '>='
|
35
|
+
- - ! '>='
|
37
36
|
- !ruby/object:Gem::Version
|
38
37
|
version: '0'
|
39
|
-
prerelease: false
|
40
38
|
type: :runtime
|
41
|
-
|
42
|
-
name: ensure_valid_encoding
|
39
|
+
prerelease: false
|
43
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
44
42
|
requirements:
|
45
|
-
- - '>='
|
43
|
+
- - ! '>='
|
46
44
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: ensure_valid_encoding
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
49
50
|
requirements:
|
50
|
-
- - '>='
|
51
|
+
- - ! '>='
|
51
52
|
- !ruby/object:Gem::Version
|
52
53
|
version: 0.5.3
|
53
|
-
prerelease: false
|
54
54
|
type: :runtime
|
55
|
-
|
56
|
-
name: bundler
|
55
|
+
prerelease: false
|
57
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.5.3
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
62
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
63
66
|
requirements:
|
64
67
|
- - ~>
|
65
68
|
- !ruby/object:Gem::Version
|
66
69
|
version: '1.3'
|
67
|
-
prerelease: false
|
68
70
|
type: :development
|
69
|
-
|
70
|
-
name: rake
|
71
|
+
prerelease: false
|
71
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
72
74
|
requirements:
|
73
|
-
- -
|
75
|
+
- - ~>
|
74
76
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
77
|
+
version: '1.3'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
76
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
77
82
|
requirements:
|
78
|
-
- - '>='
|
83
|
+
- - ! '>='
|
79
84
|
- !ruby/object:Gem::Version
|
80
85
|
version: '0'
|
81
|
-
prerelease: false
|
82
86
|
type: :development
|
83
|
-
|
84
|
-
name: minitest
|
87
|
+
prerelease: false
|
85
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
86
90
|
requirements:
|
87
|
-
- - '>='
|
91
|
+
- - ! '>='
|
88
92
|
- !ruby/object:Gem::Version
|
89
93
|
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: minitest
|
90
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
91
98
|
requirements:
|
92
|
-
- - '>='
|
99
|
+
- - ! '>='
|
93
100
|
- !ruby/object:Gem::Version
|
94
101
|
version: '0'
|
95
|
-
prerelease: false
|
96
102
|
type: :development
|
97
|
-
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
description:
|
98
111
|
email:
|
99
112
|
- jonathan@dnil.net
|
100
113
|
executables: []
|
@@ -119,28 +132,30 @@ files:
|
|
119
132
|
homepage: http://github.com/jrochkind/traject_horizon
|
120
133
|
licenses:
|
121
134
|
- MIT
|
122
|
-
|
123
|
-
post_install_message:
|
135
|
+
post_install_message:
|
124
136
|
rdoc_options: []
|
125
137
|
require_paths:
|
126
138
|
- lib
|
127
139
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
128
141
|
requirements:
|
129
|
-
- - '>='
|
142
|
+
- - ! '>='
|
130
143
|
- !ruby/object:Gem::Version
|
131
144
|
version: '0'
|
132
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
133
147
|
requirements:
|
134
|
-
- - '>='
|
148
|
+
- - ! '>='
|
135
149
|
- !ruby/object:Gem::Version
|
136
150
|
version: '0'
|
137
151
|
requirements: []
|
138
|
-
rubyforge_project:
|
139
|
-
rubygems_version:
|
140
|
-
signing_key:
|
141
|
-
specification_version:
|
152
|
+
rubyforge_project:
|
153
|
+
rubygems_version: 1.8.23
|
154
|
+
signing_key:
|
155
|
+
specification_version: 3
|
142
156
|
summary: Horizon ILS MARC Exporter, a plugin for the traject tool
|
143
157
|
test_files:
|
144
158
|
- test/horizon_bib_auth_merge_test.rb
|
145
159
|
- test/horizon_convert_text_test.rb
|
146
160
|
- test/test_helper.rb
|
161
|
+
has_rdoc:
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: c445af099fb059edc31fcf8a82737032e97ea149
|
4
|
-
data.tar.gz: 3db072af3d1202b9235d4a0dbd9c3fcd2c29699f
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 53780c5c0e8eb1d3f3929f4bb3b42f688decfafddd0c1e38ad2920b2f9e5ec690cbd656255d3d9d4f44e10bcc73b3868ce203d201e54f212360d0ffff613fca6
|
7
|
-
data.tar.gz: af84bb6b374d0bf2f4489361c9cf524b2670511369eefe0ec615f3d5b7bf0fde5950ac17466d5659fde59192e68be0f28bc531214b19faf5a993d05a9f70d49b
|