2015-06-01 17:42 GMT+02:00 Ludovic Pouzenc <[email protected]>:
> Hi,


Hello Ludovic,


>
> I try to use LSC to sync data from Oracle 10i DB to OpenLDAP 2.4.
>
> I try to sync groups. I try to not use "automagic" management of member
> attributes by the LDAP itself because it causes stupid tragic problems with
> syncrepl replication system.
>
> I manage to get a SQL query that returns entries like :
>
> cn            objectClass               member
> ....
>
> MyGroup1      groupOfNames;top
> uid=lpouzenc,ou=poeple,dc=univ-jfc,dc=fr;uid=otherguy,ou=poeple,dc=univ-jfc,dc=fr
>
> I just put ojdbc6.jar in the lib path of LSC and it goes happily. I use
> Oracle Database 11g Release 2 (11.2.0.4) JDBC Drivers and associated
> javadoc.
>
> In SQL code, I use a user func for concatenating strings because LIST_AGG()
> is Oracle >= 11 and WM_CONCAT() is unsupported, limited with VARCHAR2(4000)
> and enforces "," separator.
>
> The "member" column out of my custom function use CLOB type. I have LSC
> errors on every insert or update. LDIF dumped in the logs are like :
>
> juin 01 17:23:34 - ERROR - Error while adding entry
> cn=SG,ou=structures,ou=groups,dc=univ-jfc,dc=fr in directory
> :javax.naming.directory.InvalidAttributeValueException: Malformed 'member'
> attribute value; remaining name 'cn=SG,ou=structures,ou=groups'
> juin 01 17:23:34 - ERROR - Error while synchronizing ID
> cn=SG,ou=structures,ou=groups,dc=univ-jfc,dc=fr: java.lang.Exception:
> Technical problem while applying modifications to the destination
> # Mon Jun 01 17:23:34 CEST 2015
> dn: cn=SG,ou=structures,ou=groups,dc=univ-jfc,dc=fr
> changetype: add
> member: oracle.sql.CLOB@1f8db72d
> supannCodeEntite: 1494
> cn: SG
> description: SECRETARIAT GENERAL
> objectClass: groupOfNames
> objectClass: supannEntite
> supannCodeEntiteParent: 2
>
> It seems LSC just use toString() (or no conv at all) on this particular
> objdc type and this could not return a valid dn list.
>
> I've tried some javascript, but I'm unsuccessful :
>
>         <dataset>
>           <name>member</name>
>           <policy>FORCE</policy>
>           <forceValues>
>
> <string>js:srcBean.getDatasetFirstValueById("member").getSubString(1,10)</string>
>           </forceValues>
>         </dataset>
>
> This complains that getSubString() method is not defined. This method is
> defined in oracle.sql.CLOB but not in generic JDBC types.
>
> I know that, with the same lib in a java project that this is okay :
>
> CLOB field1 = new CLOB(null);
> field1.getSubString(1, 10);
>
> but this is not : (Datum is a super type of CLOB. Any other more generic
> type do the job):
>
> Datum field2 = new CLOB(null);
> field2.getSubString(1, 10);
>
> I'm afraid that I can't call specific oracle.sql.* methods from the
> Javascript code.
>
> Here are my questions :
>
> Could I use any CLOB with LSC ?
> Is there an alternative to big strings concat's on multi-valued attributes
> when data came from RDBMS ?
>
>
> Everything else is very great in LSC, many thanks to all folks that are
> involved.


I don't think you can manage CLOB trough javascript. The best would be
to use Oracle SQL function in the iBatis XML file, so that LSC
receives a plain string.


Clément.
_______________________________________________________________
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