Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Michael Wall
Configuring LDAP Import lock duration
October 27, 2010 3:24 AM
Answer

Michael Wall

Rank: Junior Member

Posts: 56

Join Date: July 22, 2010

Recent Posts

Hi,

I'm using Liferay 6 EE, with LDAP import scheduled every 60 mins, taking approx 30 mins.

If I stop and restart the app server (JBoss) while the import is in progress, the import is 'disabled' for 24 hours, until the lock (in the lock_) table expires / is removed. Fair enough.

I can delete the lock_ record while Liferay is not running before starting again, however my preference is to reduce the lock duration and let it expire.

Initially I tried adding the following to my portal-ext.properties (based on other properties):

lock.expiration.time.com.liferay.portal.security.ldap.PortalLDAPImporterUtil=14400000
lock.expiration.time.com.liferay.portal.security.ldap.PortalLDAPImporterImpl=14400000

After stopping, deleting the locks and restarting the new lock record still has a 24 hour duration so I looked at the code in PortalLDAPImporterImpl:

LockLocalServiceUtil.lock(defaultUserId, PortalLDAPImporterUtil.class.getName(), companyId, PortalLDAPImporterImpl.class.getName(), false, Time.DAY);

So lock duration is hardcoded to 24 hours, non configurable.

Is there any way to reduce the lock through configuration, or to have Liferay clear the lock_ table on shutdown / restart, other than waiting for the import to complete / using the Liferay Shurdown option.

I'm running in JBoss as a Windows Service using services.bat.

Thanks,
Michael
Vikash Pareek
RE: Configuring LDAP Import lock duration
January 3, 2013 11:10 PM
Answer

Vikash Pareek

Rank: New Member

Posts: 15

Join Date: December 10, 2012

Recent Posts

Hello Michael,
I have deleted all the user imported from ldap in liferay (by deactivating and then deleting).
But now i want to import those user again but i cant success.
connection with ldap server is ok with my ldap setting.
I have already enabled import on startup.
ldap server is having users also (i.e. non empty).
and deleted row (only one row avialable there) in lock_ table in database.
what am i missing for importing users.
please help me for this as soon as possible.
Rene van Reeuwijk
RE: Configuring LDAP Import lock duration
January 17, 2013 6:09 AM
Answer

Rene van Reeuwijk

Rank: New Member

Posts: 1

Join Date: January 17, 2013

Recent Posts

Hello,
What helped me in the same situation was setting the loglevels to DEBUG for com.liferay.portal.security.ldap and com.liferay.portal.security.ldap.PortalLDAPUtil
In the logfiles there were messages that Liferay still believed another ldap process was running.
After clearing all caches the import started to run again.

I have the following entries in portal-ext.properties:
ldap.import.enabled=true
ldap.import.on.startup=true
ldap.import.interval=10
ldap.auth.enabled=true

Regards Rene