comparison src/luan/modules/lucene/PostgresBackup.java @ 1428:d21a7cf8fa9e

fix postgres check
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 24 Nov 2019 21:02:38 -0700
parents 225808b90cee
children 103d0ce70385
comparison
equal deleted inserted replaced
1427:a076e89a2879 1428:d21a7cf8fa9e
198 private final LuanTable env = newEnv(); 198 private final LuanTable env = newEnv();
199 199
200 Checker() throws SQLException { 200 Checker() throws SQLException {
201 con = newConnection(); 201 con = newConnection();
202 con.setAutoCommit(false); 202 con.setAutoCommit(false);
203 con.setReadOnly(true);
204 con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
205
206 // hack to capture data in transaction
207 Statement stmt = con.createStatement();
208 ResultSet rs = stmt.executeQuery("select 'x' from lucene");
209 while(rs.next());
210 stmt.close();
211
203 pstmt = con.prepareStatement( 212 pstmt = con.prepareStatement(
204 "select data from lucene where id=?" 213 "select data from lucene where id=?"
205 ); 214 );
206 } 215 }
207 216