Ashish Vijaywargiya
6cba6c06b4
Fixing important bug that we have observed in one of the production system. This error comes when production system generates lot of JobSandbox records. And sometime it happens that purgeOldJobs service tries to remove RuntimeData from the system but runtimeDataId is still referred in JobSandbox records. To fix this bug we have separated out the code for deleting RuntimeData. We have also tested this fix on production system for about two weeks and now things are better over there. Thanks Jacopo for the discussion.
Here I am sharing console log for everyones reference:
f9cb9ec37f8ed14 Apr 28, 2012 10:47:46 PM org.apache.jk.common.ChannelSocket processConnection
f9cb9ec37f8f0fc WARNING: processCallbacks status 2
f9cbcd4388830dc 2012-04-28 23:00:10,947 (default-invoker-Thread-781938) [ GenericDelegator.java:1163:ERROR]
f9cbcd4388834c4 ---- exception report ----------------------------------------------------------
f9cbcd4388838ac Failure in removeByCondition operation for entity [RuntimeData]: org.ofbiz.entity.GenericDataSourceException: Generic Entity Exception occured in deleteByCondition (SQL Exception while executing the following:DELETE FROM public.RUNTIME_DATA WHERE (RUNTIME_DATA_ID = '45794') (ERROR: update or delete on table "runtime_data" violates foreign key constraint "job_sndbx_rntmdta" on table "job_sandbox"
f9cbcd43888d4ec Detail: Key (runtime_data_id)=(45794) is still referenced from table "job_sandbox".)). Rolling back transaction.
f9cbcd43888e48c Exception: org.ofbiz.entity.GenericDataSourceException
f9cbcd43888e874 Message: Generic Entity Exception occured in deleteByCondition (SQL Exception while executing the following:DELETE FROM public.RUNTIME_DATA WHERE (RUNTIME_DATA_ID = '45794') (ERROR: update or delete on table "runtime_data" violates foreign key constraint "job_sndbx_rntmdta" on table "job_sandbox"
f9cbcd43888ffe4 Detail: Key (runtime_data_id)=(45794) is still referenced from table "job_sandbox".))
f9cbcd4388903cc ---- cause ---------------------------------------------------------------------
f9cbcd438890b9c Exception: org.ofbiz.entity.GenericDataSourceException
f9cbcd438890f84 Message: SQL Exception while executing the following:DELETE FROM public.RUNTIME_DATA WHERE (RUNTIME_DATA_ID = '45794') (ERROR: update or delete on table "runtime_data" violates foreign key constraint "job_sndbx_rntmdta" on table "job_sandbox"
f9cbcd43889136c Detail: Key (runtime_data_id)=(45794) is still referenced from table "job_sandbox".)
f9cbcd438895da4 ---- cause ---------------------------------------------------------------------
f9cbcd43889618c Exception: org.postgresql.util.PSQLException
f9cbcd43889618c Message: ERROR: update or delete on table "runtime_data" violates foreign key constraint "job_sndbx_rntmdta" on table "job_sandbox"
f9cbcd438896574 Detail: Key (runtime_data_id)=(45794) is still referenced from table "job_sandbox".
f9cbcd43889712c ---- stack trace ---------------------------------------------------------------
f9cbcd43889712c org.postgresql.util.PSQLException: ERROR: update or delete on table "runtime_data" violates foreign key constraint "job_sndbx_rntmdta" on table "job_sandbox"
f9cbcd43889889c Detail: Key (runtime_data_id)=(45794) is still referenced from table "job_sandbox".
f9cbcd43889889c org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
f9cbcd438898c84 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
f9cbcd438899454 org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
f9cbcd43889983c org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
f9cbcd43889983c org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
f9cbcd438899c24 org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
f9cbcd43889a3f4 org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
f9cbcd43889a7dc org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
f9cbcd43889abc4 org.ofbiz.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:420)
f9cbcd43889abc4 org.ofbiz.entity.datasource.GenericDAO.deleteByCondition(GenericDAO.java:1158)
f9cbcd43889bb64 org.ofbiz.entity.datasource.GenericDAO.deleteByCondition(GenericDAO.java:1132)
f9cbcd43889bf4c org.ofbiz.entity.datasource.GenericHelperDAO.removeByCondition(GenericHelperDAO.java:160)
f9cbcd43889c334 org.ofbiz.entity.GenericDelegator.removeByCondition(GenericDelegator.java:1152)
f9cbcd43889c334 org.ofbiz.entity.GenericDelegator.removeByAnd(GenericDelegator.java:1120)
f9cbcd43889cb04 org.ofbiz.entity.GenericDelegator.removeByAnd(GenericDelegator.java:1105)
f9cbcd43889ceec org.ofbiz.entity.GenericDelegator.removeByAnd(GenericDelegator.java:1098)
f9cbcd43889ceec org.ofbiz.service.ServiceUtil.purgeOldJobs(ServiceUtil.java:476)
f9cbcd43889d2d4 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
f9cbcd43889d2d4 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
f9cbcd43889de8c sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
f9cbcd43889de8c java.lang.reflect.Method.invoke(Method.java:597)
f9cbcd43889e274 org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100)
f9cbcd43889e274 org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57)
f9cbcd43889f5fc org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:396)
f9cbcd43889f9e4 org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:224)
f9cbcd43889f9e4 org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:163)
f9cbcd43889fdcc org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:71)
f9cbcd43889fdcc org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:242)
f9cbcd4388a3c4c java.lang.Thread.run(Thread.java:662)
f9cbcd4388a3c4c --------------------------------------------------------------------------------
f9cbcd4388a4034
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341770 13f79535-47bb-0310-9956-ffa450edef68
2012-05-23 07:57:31 +00:00
..
2012-05-09 05:28:17 +00:00
2012-05-21 14:40:23 +00:00
2012-05-14 20:59:54 +00:00
2012-02-28 02:48:54 +00:00
2012-05-09 05:28:17 +00:00
2012-05-22 10:57:13 +00:00
2012-05-09 05:28:17 +00:00
2012-04-28 11:30:14 +00:00
2012-05-20 08:21:18 +00:00
2012-05-14 20:59:54 +00:00
2011-02-09 20:49:28 +00:00
2012-05-14 09:15:10 +00:00
2012-05-12 21:17:55 +00:00
2012-03-27 16:18:42 +00:00
2012-05-22 11:13:26 +00:00
2012-02-28 07:19:35 +00:00
2012-05-14 20:59:54 +00:00
2012-05-23 07:57:31 +00:00
2011-09-11 17:06:11 +00:00
2012-05-05 07:52:25 +00:00
2012-05-19 08:45:18 +00:00
2012-05-21 14:39:51 +00:00
2012-05-20 08:21:18 +00:00
2012-05-21 16:22:57 +00:00
2012-04-21 19:19:09 +00:00
2012-04-21 19:19:09 +00:00