LSC rightfully assumes that your pivot attributes can be used for 
comparison without manipulation.  Another suggestion would be to reverse 
the work around.  If you're concerned about manipulating your database 
then add the truncated full name as an attribute in your directory. You're 
still going to run in to the issue where your pivot attribute(s) must 
identify a unique record.  You must choose an attribute or combination of 
attributes that will uniquely identify a record in both places and use 
those as your pivot attributes.  This is a fundamental requirement for 
synchronization regardless of the tool.  You are going to run in to all 
kinds of trouble if you can't find something else to replace or augment 
your pivot attribute(s). 

-Jon C. Kidder
American Electric Power
Middleware Services
614-716-4970



Natan Sanson <[email protected]> 
01/17/2013 09:22 AM

To
[email protected]
cc
[email protected], [email protected]
Subject
Re: [lsc-users] two questions about lsc and db synchronization






Hi Jon, thank you for you reply to my first question

Ok, It is not a good thing altering the user table of a DBMS, but this is 
not the point. Assume that the destination attribute doesn't accept white 
spaces and I have the source attribute composed with spaces, is there any 
way to manipulate the compared attribute before the effective comparison? 
The only solution is creating an additional filed (in the soure or 
destination object)?
The real question here is "Can I compare a manipulated source attribute 
instead of a source attribute"? And you answer is clear: It is not 
possible with lsc. You have to do it with a workaround

Thank you,

    Natan

On Thu, Jan 17, 2013 at 3:13 PM, <[email protected]> wrote:

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
614-716-4970 



Natan Sanson <[email protected]> 
Sent by: [email protected] 
01/17/2013 07:55 AM 


To
[email protected] 
cc

Subject
[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.  

1) 
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. 

<dataset> 
<name>fullName</name> 
<policy>KEEP</policy> 
<forceValues> 
<string> 
var result = "";  
if (srcBean.getDatasetFirstValueById("fullName").length() > 15) result = 
srcBean.getDatasetFirstValueById("fullName").substring(0,16);  
else result = srcBean.getDatasetFirstValueById("fullName"); result; 
</string> 
</forceValues> 
</dataset> 
<dataset> 
  
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> 
<select id="getInetOrgPerson" resultClass="java.util.HashMap" 
parameterClass="java.util.Map"> 

SELECT User as fullName, Password as userPassword FROM user WHERE User = 
#fullname# 
</select> 
<insert id="insertInetOrgPerson" parameterClass="java.util.Map"> 
INSERT INTO user 
(Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_priv,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv,Event_priv,Trigger_priv,ssl_type,ssl_cipher,x509_issuer,x509_subject,max_questions,max_updates,max_connections,max_user_connections)
 
VALUES 
('localhost',#fullname#,"defaulthashedpassword",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','','0','0','0','0')
 

</insert> 
<update id="updateInetOrgPerson" parameterClass="java.util.Map"> 
UPDATE user SET Password=PASSWORD(#userpassword#) WHERE User=#fullname# 
</update> 
<delete id="deleteInetOrgPerson" parameterClass="java.util.Map"> 
.... 
</delete> 
</sqlMap> 

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 

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

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


_______________________________________________________________
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