Hi Everyone,

Does anyone know if it is possible in lsc.xml, during create, to access values 
assigned to one attribute from another?
Or failing that, to somehow pass something from one attribute to another by 
writing to global variables or something?

Thanks,
Trev

From: 
<[email protected]<mailto:[email protected]>>
 on behalf of Trevor Fong
Date: Friday, July 22, 2016 at 3:07 PM
To: "[email protected]<mailto:[email protected]>"
Subject: Re: [lsc-users] Accessing Values From One Dataset In Another

Hi LSC Team,

Further to this, the documentation page 
http://lsc-project.org/wiki/documentation/2.0/configuration/syncoptions/sequences
 recommends that we use an object of objectless "device" and maintain the 
sequence in the "serialNumber" attribute.  There should always only be one 
serialNumber, but we have had an occasion where there have been more than one 
serialNumber value, each with a different value, leading to non-unique 
uidNumber and gidNumber being issued.  We don't know how this occurred, but one 
possibility that does come to mind is that perhaps 
SequencesFactory.getInstance(...).getNextValue() is not thread safe?

Scanning the code, it is using the "traditional" java singleton pattern:
From org.lsc.utils.SequencesFactory:


/** the factory instance */

privatestatic SequencesFactory instance;

...


publicstatic SequencesFactory getInstance(JndiServices services) {

if (instance == null) {

LOGGER.info("Initializing the sequences factory.");

instance = new SequencesFactory(services);

}

returninstance;

}


This has been shown in many articles online to be non-threadsafe as it's 
possible for a thread to undergo and pass the "instance == null" check just 
before a competing thread is assigned a new instance, resulting an multiple 
instances.  There are several solutions, each with it's own pros and cons: 
http://www.journaldev.com/1377/java-singleton-design-pattern-best-practices-examples

Thanks,
Trev


On 2016-07-22, 9:31 AM, 
"[email protected]<mailto:[email protected]>
 on behalf of Fong, Trevor" 
<[email protected]<mailto:[email protected]>
 on behalf of [email protected]<mailto:[email protected]>> wrote:

Hi Raphael,

Thanks very much for the suggestion.  I will consider this, but it may not be 
feasible as we use a db view of the < 5 minute old changed accounts as the 
source; running 2 tasks with against such a source runs a risk of the result 
sets from the two tasks being different.

Does anyone know about OrderedValuesBean, or have any other suggestions?

Thanks,
Trev



On 2016-07-22, 8:49 AM, "Raphael OUAZANA" 
<[email protected]<mailto:[email protected]>> wrote:

Hi,

You can have 2 tasks, the first one filling uidNumber, and the second
one filling gidNumber based on uidNumber.

Regards,
Raphaël Ouazana.

Le 2016-07-22 03:39, Fong, Trevor a écrit :
Hi Everyone,
We're looking to use the same value for gidNumber and uidNumber.
We are following the approach outlined here:
http://lsc-project.org/wiki/documentation/2.0/configuration/syncoptions/sequences:
uidNumber calls method getNextValue
gidNumber calls method getCurrentValue
The problem is that the order of processing the attributes doesn't
seem to be guaranteed;
   * if uidNumber is processed first, then gidNumber will have the same
value
* If gidNumber is processed first, then uidNumber will have the next
value
Is there a way to either:
   * access the value of one <dataset> from another, or
* Write to a global variable
I noticed that there is a org.lsc.beans.OrderedValuesBean - will this
bean guarantee the order of execution of datasets?  If so, in what
order - I've tried it and have noticed that the order it processes is
different from that specified in lsc.xml.
Thanks a lot,
Trev
  _________________________________________________
  TREVOR FONG
  _Senior Programmer Analyst_
Information Technology | Engage. Envision. Enable.
  THE UNIVERSITY OF BRITISH COLUMBIA
  [email protected]<mailto:[email protected]> | 1-604-827-5247 [1] | 
it.ubc.ca [2]
Links:
------
[1] tel:604-827-5247
[2] http://it.ubc.ca
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]<mailto:[email protected]>
http://lists.lsc-project.org/listinfo/lsc-users
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]<mailto:[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