Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sandeep Nair
ConstraintViolationException after Read Write DB configuration
January 13, 2011 6:35 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1732

Join Date: November 5, 2008

Recent Posts

Hi,

We have configured Liferay to use Read write Db configuration. The application starts up fine and replication too is working.

But when i try to add a new community or post new thread i am getting Constraint Violation Exception.

Can anyone help me out plz. I am attaching the log.

Sorry is not allowing to attach log so posting it here itself

  115:20:36,678 ERROR [JDBCExceptionReporter:101] Duplicate entry '206' for key 1
  215:20:36,752 ERROR [jsp:154] com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  3        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:195)
  4        at com.liferay.portal.service.persistence.ResourcePermissionPersistenceImpl.updateImpl(ResourcePermissionPersistenceImpl.java:356)
  5        at com.liferay.portal.service.persistence.ResourcePermissionPersistenceImpl.updateImpl(ResourcePermissionPersistenceImpl.java:66)
  6        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:262)
  7        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:371)
  8        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.updateResourcePermission(ResourcePermissionLocalServiceImpl.java:387)
  9        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.setResourcePermissions(ResourcePermissionLocalServiceImpl.java:301)
 10        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:78)
 11        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 12        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 13        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 14        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 15        at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources_6(ResourceLocalServiceImpl.java:778)
 16        at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:192)
 17        at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:151)
 18        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:78)
 19        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 20        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 21        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 22        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 23Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
 24        at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
 25        at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:118)
 26        at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.flush(ClassLoaderSession.java:176)
 27        at com.liferay.portal.service.persistence.BatchSessionImpl.update(BatchSessionImpl.java:95)
 28        at com.liferay.portal.service.persistence.BatchSessionUtil.update(BatchSessionUtil.java:49)
 29        at com.liferay.portal.service.persistence.ResourcePermissionPersistenceImpl.updateImpl(ResourcePermissionPersistenceImpl.java:351)
 30        at com.liferay.portal.service.persistence.ResourcePermissionPersistenceImpl.updateImpl(ResourcePermissionPersistenceImpl.java:66)
 31        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:262)
 32        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:371)
 33        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.updateResourcePermission(ResourcePermissionLocalServiceImpl.java:387)
 34        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.setResourcePermissions(ResourcePermissionLocalServiceImpl.java:301)
 35        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 36        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 37        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 38        at java.lang.reflect.Method.invoke(Method.java:597)
 39        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 40        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 41        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 42        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
 43        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:78)
 44        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 45        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 46        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 47        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 48        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 49        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 50        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 51        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 52        at $Proxy70.setResourcePermissions(Unknown Source)
 53        at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources_6(ResourceLocalServiceImpl.java:778)
 54        at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:192)
 55        at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:151)
 56        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 57        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 58        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 59        at java.lang.reflect.Method.invoke(Method.java:597)
 60        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 61        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 62        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 63        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
 64        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:78)
 65        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 66        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 67        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 68        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 69        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 70        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 71        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 72        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 73        at $Proxy66.addResources(Unknown Source)
 74        at com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:209)
 75        at com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:103)
 76        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 77        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 78        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 79        at java.lang.reflect.Method.invoke(Method.java:597)
 80        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 81        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 82        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 83        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
 84        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:78)
 85        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 86        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 87        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 88        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 89        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 90        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 91        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 92        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 93        at $Proxy25.addGroup(Unknown Source)
 94        at com.liferay.portal.service.impl.GroupServiceImpl.addGroup(GroupServiceImpl.java:49)
 95        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 96        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 97        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 98        at java.lang.reflect.Method.invoke(Method.java:597)
 99        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
100        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
101        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
102        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
103        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:78)
104        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
105        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
106        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
107        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
108        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
109        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
110        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
111        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
112        at $Proxy26.addGroup(Unknown Source)
113        at com.liferay.portal.service.GroupServiceUtil.addGroup(GroupServiceUtil.java:43)
114        at com.liferay.portlet.communities.action.EditGroupAction.updateGroup(EditGroupAction.java:168)
115        at com.liferay.portlet.communities.action.EditGroupAction.processAction(EditGroupAction.java:69)
116        at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:169)
117        at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:186)
118        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
119        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
120        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:652)
121        at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:687)
122        at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:360)
123        at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:768)
124        at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:571)
125        at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:229)
126        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
127        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
128        at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:154)
129        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
130        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
131        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
132        at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:508)
133        at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:485)
134        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
135        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
136        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
137        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
138        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
139        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
140        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
141        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
142        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
143        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
144        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
145        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
146        at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:309)
147        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
148        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
149        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
150        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
151        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
152        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
153        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
154        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
155        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:137)
156        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
157        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
158        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
159        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
160        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:182)
161        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
162        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
163        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
164        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
165        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:256)
166        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
167        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
168        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
169        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
170        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
171        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
172        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
173        at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:134)
174        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
175        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
176        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
177        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
178        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
179        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
180        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
181        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
182        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
183        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
184        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
185        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
186        at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:261)
187        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
188        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
189        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
190        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
191        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
192        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
193        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
194        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
195        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126)
196        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
197        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
198        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
199        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
200        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:182)
201        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
202        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
203        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
204        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
205        at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:222)
206        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
207        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
208        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
209        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
210        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
211        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
212        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
213        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
214        at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:440)
215        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
216        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
217        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
218        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
219        at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:45)
220        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
221        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
222        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
223        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
224        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:256)
225        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
226        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
227        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
228        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
229        at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:81)
230        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
231        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
232        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
233        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
234        at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:181)
235        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
236        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
237        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
238        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
239        at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:245)
240        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
241        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
242        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
243        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
244        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
245        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
246        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
247        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
248        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
249        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
250        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
251        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
252        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
253        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
254        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
255        at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:40)
256        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
257        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
258        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
259        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
260        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
261        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
262        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
263        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
264        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
265        at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227)
266        at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
267        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
268        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
269        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
270        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
271        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
272        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
273        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
274        at java.lang.Thread.run(Thread.java:662)
275Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
276        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
277        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
278        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
279        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:262)
280        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178)
281        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
282        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
283        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
284        at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:115)
285        ... 249 more
286Caused by: java.sql.BatchUpdateException: Duplicate entry '206' for key 1
287        at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1257)
288        at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:943)
289        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
290        at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
291        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
292        ... 255 more



Regards,
Sandeep
Sandeep Nair
RE: ConstraintViolationException after Read Write DB configuration
January 13, 2011 7:11 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1732

Join Date: November 5, 2008

Recent Posts

Hi,

The question that now comes into my mind is while configuring read write db should i comment infrastructure-spring.xml when i am uncommenting dynamic-data-source-spring.xml

Regards,
Sandeep
Sandeep Nair
RE: ConstraintViolationException after Read Write DB configuration
January 14, 2011 12:13 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1732

Join Date: November 5, 2008

Recent Posts

Any help is much appreciated.
Sandeep Nair
RE: ConstraintViolationException after Read Write DB configuration
January 14, 2011 6:45 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1732

Join Date: November 5, 2008

Recent Posts

I feel there is a bug in Liferay even in EE version for this read write db config. If you specify the following
 1
 2spring.configs=\
 3        META-INF/base-spring.xml,\
 4        \
 5        META-INF/hibernate-spring.xml,\
 6        META-INF/infrastructure-spring.xml,\
 7        META-INF/management-spring.xml,\
 8        \
 9        META-INF/util-spring.xml,\
10        \
11        META-INF/jpa-spring.xml,\
12        \
13        META-INF/audit-spring.xml,\
14        META-INF/cluster-spring.xml,\
15        META-INF/editor-spring.xml,\
16        META-INF/jcr-spring.xml,\
17        META-INF/ldap-spring.xml,\
18        META-INF/messaging-core-spring.xml,\
19        META-INF/messaging-misc-spring.xml,\
20        META-INF/poller-spring.xml,\
21        META-INF/rules-spring.xml,\
22        META-INF/scheduler-spring.xml,\
23        META-INF/scripting-spring.xml,\
24        META-INF/search-spring.xml,\
25        META-INF/workflow-spring.xml,\
26        \
27        META-INF/counter-spring.xml,\
28        META-INF/document-library-spring.xml,\
29        META-INF/mail-spring.xml,\
30        META-INF/portal-spring.xml,\
31        META-INF/portlet-container-spring.xml,\
32        \
33        META-INF/dynamic-data-source-spring.xml,\
34        #META-INF/shard-data-source-spring.xml,\
35        #META-INF/memcached-spring.xml,\
36        #META-INF/monitoring-spring.xml,\
37        \
38        META-INF/ext-spring.xml


We can see in above that even infrastructure-spring.xml is there which means jdbc.default.* jndi name is still considered. No doubt it uses both read and write db that we configured in portal-ext.properties, it is also trying to use jdbc.default.* properties which is there in portal.properties and hence using hypersonic too which is causing the above problem.

Can any liferay guys confirm the same?

Regards,
Sandeep
Chicon Samu
RE: ConstraintViolationException after Read Write DB configuration
July 23, 2011 1:11 AM
Answer

Chicon Samu

Rank: Regular Member

Posts: 120

Join Date: August 30, 2007

Recent Posts

hi, did you solve your problem? If yes, let me know how you did it! Thanks!
Sandeep Nair
RE: ConstraintViolationException after Read Write DB configuration
July 24, 2011 9:33 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1732

Join Date: November 5, 2008

Recent Posts

No, I didnt. emoticon
Suyash Bhalekar
RE: ConstraintViolationException after Read Write DB configuration
March 19, 2013 3:17 AM
Answer

Suyash Bhalekar

Rank: New Member

Posts: 22

Join Date: September 4, 2012

Recent Posts

Any updates?emoticon
Ben Collins
RE: ConstraintViolationException after Read Write DB configuration
February 17, 2014 5:16 AM
Answer

Ben Collins

Rank: New Member

Posts: 21

Join Date: October 19, 2012

Recent Posts

I've come across exactly the same issue.

Checking the catalina.out log I see a reference to Hypersonic as you pointed out. I can actually get rid of the hypersonic issue by setting the jdbc.default.jndi.name setting to the same as the jdbc.write.jndi.name.

Whilst these seems to have resolved the issue I still have had one occurrence since, so I am not convinced this works.

I tend to see my issue manifest itself immediately after someone logs into the portal (though its not every time, it just happens at some point... grr)

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!