liferay与LDAP数据同步问题

现在在公司做一个数据同步操作,就是从LDAP把数据同步到liferay,共有4万多条数据,但是同步2万多条数据的时候就无法在同步
报的错误如下:
15:46:55,625 ERROR [PortalLDAPUtil] Error importing LDAP users and groups
com.liferay.portal.SystemException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at com.liferay.portal.spring.hibernate.HibernateUtil.processException(HibernateUtil.java:212)
at com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistenceImpl.updateImpl(AnnouncementsDeliveryPersistenceImpl.java:233)
at com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistenceImpl.update(AnnouncementsDeliveryPersistenceImpl.java:193)
at com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryLocalServiceImpl.getUserDelivery(AnnouncementsDeliveryLocalServiceImpl.java:106)
at com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryLocalServiceImpl.getUserDeliveries(AnnouncementsDeliveryLocalServiceImpl.java:80)
at com.liferay.portal.service.impl.UserLocalServiceImpl.updateUser(UserLocalServiceImpl.java:1882)
at com.liferay.portal.service.impl.UserLocalServiceImpl.updateUser(UserLocalServiceImpl.java:1733)
at sun.reflect.GeneratedMethodAccessor326.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy147.updateUser(Unknown Source)
at com.liferay.portal.service.UserLocalServiceUtil.updateUser(UserLocalServiceUtil.java:934)
at com.liferay.portal.security.ldap.PortalLDAPUtil.importLDAPUser(PortalLDAPUtil.java:748)
at com.liferay.portal.security.ldap.PortalLDAPUtil.importFromLDAP(PortalLDAPUtil.java:494)
at com.liferay.portal.security.ldap.PortalLDAPUtil.importFromLDAP(PortalLDAPUtil.java:463)
at com.liferay.portlet.admin.job.LDAPImportJob.execute(LDAPImportJob.java:66)
at com.liferay.portal.job.JobWrapper.execute(JobWrapper.java:62)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at com.liferay.util.dao.hibernate.LiferaySession.flush(LiferaySession.java:171)
at com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistenceImpl.updateImpl(AnnouncementsDeliveryPersistenceImpl.java:226)
... 23 more
Caused by: java.sql.BatchUpdateException: 违反了 PRIMARY KEY 约束 'PK__AnnouncementsDel__7B905C75'。不能在对象 'AnnouncementsDelivery' 中插入重复键。
at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:835)
at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 30 more
希望高手指点,谢谢。

你可能感兴趣的:(java,AOP,Hibernate,quartz,jdbc)