Hi LSC users,

I noticed that when I use LSC 2.0.3 to synchronize JDBC (Oracle) source to LDAP (OpenLDAP) destination is asynchronous mode it fails as soon as one of the result column in JDBC contains a NULL value. The offending code is in LscAttributes class, in method getStringValueAttribute. I have added the check on set size (&& ((Set)value).size() == 1) to avoid throwing a NoSuchElementException:

        @SuppressWarnings("rawtypes")
        public String getStringValueAttribute(String attribute) {
                Object value = values.get(attribute);
                if(value instanceof Set && ((Set)value).size() == 1) {
                        return ((Set)value).iterator().next().toString();
                } else if(value instanceof List){
                        return ((List)value).get(0).toString();
                }
                return value != null ? value.toString() : null;
        }


I tried to use nullValue attribute (set to empty string "") in iBatis XML configuration file but it still considers the attribute as an empty Set.
How to deal with empty/NULL properties in asynchronous mode ?
The same configuration used in synchronous mode does run successfully.

kind regards,
Manuel.

_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to