Mercurial Hosting > luan
comparison src/luan/modules/lucene/PostgresBackup.java @ 1528:3bd4d7963456
use goodjava/lucene/api
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 26 Jul 2020 23:11:53 -0600 |
parents | 219f2b937f2b |
children | c27dc6af87ca |
comparison
equal
deleted
inserted
replaced
1527:fa1e3adbebfb | 1528:3bd4d7963456 |
---|---|
153 throw new LuanException("rollback failed trans="+trans); | 153 throw new LuanException("rollback failed trans="+trans); |
154 con.rollback(); | 154 con.rollback(); |
155 con.setAutoCommit(true); | 155 con.setAutoCommit(true); |
156 } | 156 } |
157 | 157 |
158 void restoreLucene(LuceneIndex li,LuanFunction completer) | 158 void restoreLucene(LuceneIndex li) |
159 throws LuanException, IOException, SQLException, ParseException | 159 throws LuanException, IOException, SQLException, ParseException |
160 { | 160 { |
161 Luan luan = new Luan(); | 161 Luan luan = new Luan(); |
162 Statement stmt = con.createStatement(); | 162 Statement stmt = con.createStatement(); |
163 ResultSet rs = stmt.executeQuery("select data from lucene"); | 163 ResultSet rs = stmt.executeQuery("select data from lucene"); |
164 while( rs.next() ) { | 164 while( rs.next() ) { |
165 String data = rs.getString("data"); | 165 String data = rs.getString("data"); |
166 LuanTable doc = (LuanTable)LuanParser.parse(luan,data); | 166 LuanTable doc = (LuanTable)LuanParser.parse(luan,data); |
167 li.restore(completer,doc); | 167 li.restore(doc); |
168 } | 168 } |
169 stmt.close(); | 169 stmt.close(); |
170 } | 170 } |
171 | 171 |
172 long maxId() | 172 long maxId() |