Hi Mike,

On 30/07/2019 18:50, Mike Hollingsworth wrote:

> Jul 30 10:44:54 - WARN  - Error while looking for a specific entry with 
> id=kaiyahharger06 (com.ibatis.common.jdbc.exception.NestedSQLException:  
> --- The error occurred in file:///etc/lsc/sql-map-config.d/InetOrgPerson.xml. 
>  
> --- The error occurred while executing query.  
> --- Check the    Select    'inetOrgPerson' objectClass,    pers."UID" AS uid, 
>    pers."SN" AS sn,    pers."DISPLAYNAME" AS displayname,    pers."CN" AS cn, 
>    pers."MAIL" AS mail,    pers."EMPLOYEETYPE" AS employeetype,    
> pers."EMPLOYEENUMBER" AS employeenumber,    pers."USERPASSWORD" AS 
> userpassword,    pers "DESCRIPTION" AS description,                         
> pers "DN" AS dn,   FROM csvdata pers   WHERE pers."MAIL" LIKE ?  .  
> --- Check the SQL Statement (preparation failed).  
> --- Cause: java.sql.SQLException: Unexpected token AS, requires FROM in 
> statement [   Select    'inetOrgPerson' objectClass,    pers."UID" AS uid,    
> pers."SN" AS sn,    pers."DISPLAYNAME" AS displayname,    pers."CN" AS cn,    
> pers."MAIL" AS mail,    pers."EMPLOYEETYPE" AS employeetype,    
> pers."EMPLOYEENUMBER" AS employeenumber,    pers."USERPASSWORD" AS 
> userpassword,    pers "DESCRIPTION" AS description,                         
> pers "DN" AS dn,   FROM csvdata pers   WHERE pers."MAIL" LIKE ?  ])


Your request does not works :

pers."EMPLOYEENUMBER" AS employeenumber,
pers."USERPASSWORD" AS userpassword,
pers "DESCRIPTION" AS description, => should be pers."DESCRIPTION" AS 
description (missing a ".")
pers "DN" AS dn, => should be pers."DN" AS dn (missing a ".")

> I got the sync to work but it is deleting existing users , I believe because 
> of an error in InetOrgPerson.xml I have attached file.
> 

To avoid user deletion all together : set <delete>true</delete> in conditions 
or/and do not call the clean phase (remove -c from lsc command).

To delete user in destination that do not exist anymore in source (the purpose 
of clean phase) : getAllFilter in destinationService should return all entries 
that are to be sync by LSC and SQL request requestNameForClean in source should 
use an attribute (ex: #uid#) that is fetched from destination.

How it works: During clean phase, LSC collect destination entries using 
getAllFilter, then for each record it will call requestNameForClean to find a 
match in source. If no match is found in source, the entry will be deleted in 
destination (if delete condition is true), as it means that entry was deleted 
in source. 

Regards
-- 
Soisik Froger | Software Architect

soisik.fro...@worteks.com

Worteks | https://www.worteks.com
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
lsc-users@lists.lsc-project.org
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to