Dear LSC users,
I've setup an Oracle to LDAP LSC synchronization.
Initially, I had set up my SQL queries to return the most recent
updated object.
Now, I'm trying to "optimize" my queries to return only a row if an
update occured in the last polling interval (5 minutes).
But, it looks like getNextId does not allow to return null: in
SimpleJdbcSourceService.getNextId() method:
@SuppressWarnings("unchecked")
public Entry<String, LscDatasets> getNextId() {
Map<String, Object> idMap;
try {
idMap = (Map<String, Object>)
sqlMapper.queryForObject(getRequestNameForNextId());
String key = getMapKey(idMap, count++);
idMap is supposed to be never null otherwise a NPE occurs in getMapKey
method.
Nevertheless, AbstractSynchronize.run() method looks like to handle
getNextId returning null:
IAsynchronousService aSrcService = (IAsynchronousService)
task.getSourceService();
boolean interrupted = false;
while (!interrupted) {
nextId = aSrcService.getNextId();
if (nextId != null) {
run(nextId);
counter.incrementCountAll();
} else {
try {
Thread.sleep(aSrcService.getInterval() * 1000);
} catch (InterruptedException
e) {
AbstractSynchronize.LOGGER.debug("Synchronization thread
interrupted !");
interrupted = true;
}
}
}
Returning no row also allows to sleep for the requested interval in the
configuration file instead of always requesting the same info from the
LDAP server.
Am I missing something?
Kind regrds,
Manuel.
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users