[lsc-users] two questions about lsc and db synchronization

jckidder at aep.com jckidder at aep.com
Thu Jan 17 15:13:59 CET 2013

Natan, I'm assuming you're truncating the full name because of 
restrictions imposed by an application??  You won't be able to manipulate 
the pivot attribute before it is used in evaluations.  Instead, why don't 
you create a second arbitrary field in your table that  contains the 
complete full name and use that as your pivot attribute?  You can then 
simply manage the field that contains the truncated name as an ordinary 
attribute.  Even if you could manipulate the pivot attribute you couldn't 
use truncated full name because the pivot attribute or combination of 
pivot attributes must define a unique record. 

-Jon C. Kidder
American Electric Power
Middleware Services

Natan Sanson <nsanson at gmail.com> 
Sent by: lsc-users-bounces at lists.lsc-project.org
01/17/2013 07:55 AM

lsc-users at lists.lsc-project.org

[lsc-users] two questions about lsc and db synchronization

Hi, I have two doubts about lsc capabilities. 

I'm trying to synchronize an ldap source with a jdbc destionation. The 
destination is a MYSQL and I'm trying to populate mysql.user table. 

I'm able to to the synchronization but the "User" field is a Char(16). In 
the source configuration I want to use the ldap attribute "fullName" as 
pivotAttribute.  To create all the user entries I have to force the values 
and insert only the first 16 chars.

var result = ""; 
if (srcBean.getDatasetFirstValueById("fullName").length() > 15) result = 
else result = srcBean.getDatasetFirstValueById("fullName"); result;
This works as expected but then if i launch a second time the "lsc -s 
all", the process compare the entire fullName as pivot attribute and retry 
to create the trimmed entry, giving error.

Is there any way to manipulate the pivotAttribute before comparing it with 
the destination source?

My SqlMap

<sqlMap namespace="InetOrgPerson">
<select id="getInetOrgPersonList" resultClass="java.util.HashMap">
<!-- SELECT pers.User AS id -->
SELECT User AS fullName FROM user
<select id="getInetOrgPerson" resultClass="java.util.HashMap" parameterClass="java.util.Map">
SELECT User as fullName, Password as userPassword FROM user WHERE User = 
<insert id="insertInetOrgPerson" parameterClass="java.util.Map">
<update id="updateInetOrgPerson" parameterClass="java.util.Map">
UPDATE user SET Password=PASSWORD(#userpassword#) WHERE User=#fullname#
<delete id="deleteInetOrgPerson" parameterClass="java.util.Map">

I know this isn't a best practice because username should be unique and a 
truncation can generate multiple associations with the same mysql user, 
but this is only for test purpose

2) during the update, I'm not able to instruct a "FLUSH PRIVILEGES" 
command to mysql via lsc. Is there any way to send it via lsc? Should I 
write a stored procedure in mysql? But in this case, is lsc able to handle 
stored procedure calls?

Thanks in advance for any help

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

lsc-users mailing list
lsc-users at lists.lsc-project.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lsc-project.org/pipermail/lsc-users/attachments/20130117/e6ce97bd/attachment-0001.htm>

More information about the lsc-users mailing list