}
@Override
protected List<IndexJournal<T>> findContentReindexEntriesToReindex()
throws DotDataException {
DotConnect dc = new DotConnect();
List<IndexJournal<T>> x = new ArrayList<IndexJournal<T>>();
List<Map<String, Object>> results;
Connection con = null;
String serverId = ConfigUtils.getServerId();
try {
con = DbConnectionFactory.getConnection();
con.setAutoCommit(false);
if(DbConnectionFactory.isOracle()) {
CallableStatement call = con.prepareCall("{ ? = call load_records_to_index(?,?) }");
call.registerOutParameter(1, OracleTypes.CURSOR);
call.setString(2, serverId);
call.setInt(3, 50);
call.execute();
ResultSet r = (ResultSet)call.getObject(1);
results = new ArrayList<Map<String,Object>>();
while(r.next()) {
Map<String,Object> m=new HashMap<String,Object>();
m.put("id", r.getInt("id"));
m.put("inode_to_index", r.getString("inode_to_index"));
m.put("ident_to_index", r.getString("ident_to_index"));
m.put("priority", r.getInt("priority"));
results.add(m);
}
r.close();
call.close();
} else if(DbConnectionFactory.isMsSql()) {
// we need to make sure this setting is ON because of the READPAST we use
// in the stored procedure
dc.setSQL("SET TRANSACTION ISOLATION LEVEL READ COMMITTED;");
dc.loadResult();
dc.setSQL("load_records_to_index @server_id='"+serverId+"', @records_to_fetch=50");
dc.setForceQuery(true);
results = dc.loadObjectResults(con);
} else if(DbConnectionFactory.isH2()) {
dc.setSQL("call load_records_to_index(?,?)");
dc.addParam(serverId);
dc.addParam(50);
results = dc.loadObjectResults();
} else {
dc.setSQL(REINDEXENTRIESSELECTSQL);
dc.addParam(serverId);
dc.addParam(50);
results = dc.loadObjectResults(con);
}
for (Map<String, Object> r : results) {
IndexJournal<T> ij = new IndexJournal<T>();
ij.setId(((Number)r.get("id")).longValue());