How to solve- !MESSAGE Error synchronizing RepoLoad 4309 for dloc Eternity?
S
Subham Dixit
started a topic
over 2 years ago
org.springframework.dao.IncorrectResultSizeDataAccessException: Incorrect result size: expected 1, actual 2
at org.springframework.dao.support.DataAccessUtils.nullableSingleResult(DataAccessUtils.java:100)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:237)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:245)
at com.semarchy.platform.integration.polling.dlbatch.RepoLoadDao.queryRepoLoad(RepoLoadDao.java:153)
at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.checkRepoLoadOptimisticLocking(DlBatchSynchronizer.java:205)
at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.lambda$6(DlBatchSynchronizer.java:199)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.lambda$5(DlBatchSynchronizer.java:196)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.synchronizeRepoLoad(DlBatchSynchronizer.java:196)
at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.synchronizeDlBatchForDesynchronizedLoads(DlBatchSynchronizer.java:111)
at com.semarchy.platform.integration.polling.IntegrationLoadDequeuer.dequeue(IntegrationLoadDequeuer.java:514)
at com.semarchy.platform.integration.polling.AbstractIntegrationBatchPoller.dequeue(AbstractIntegrationBatchPoller.java:155)
at com.semarchy.platform.integration.polling.quartz.QuartzIntegrationBatchPoller.execute(QuartzIntegrationBatchPoller.java:214)
at com.semarchy.platform.integration.polling.quartz.QuartzIntegrationBatchPoller$SemarchyJob.execute(QuartzIntegrationBatchPoller.java:240)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Best Answer
S
Subham Dixit
said
over 2 years ago
You must have grabbed a data location from another environment with pending loads or something so.
You have to pass this query to put it in order:
merge into sem_repository.MTA_INTEG_LOAD T
using (select IL.UUID UUID, IL.REVISION IL_REVISION, IB.REVISION IB_REVISION
from sem_repository.MTA_INTEG_LOAD IL
inner join sem_repository.MTA_DATA_LOCATION DL on (IL.O_DATALOCATION = DL.UUID)
left join sem_repository.MTA_INTEG_BATCH IB on IB.R_INTEGLOAD = IL.UUID
where IL.CLASSNAME <> 'ContinuousLoad' and DL. NAME in ('$$DL_NAMES$$')
and (IL.LAST_DL_BATCH_SYNCED_REVISION is null or IL.LAST_DL_BATCH_SYNCED_REVISION < IL.REVISION or (IB.REVISION is not null and IL.LAST_DL_BATCH_SYNCED_REVISION < IB.REVISION) ) ) S
on (T.UUID = S.UUID)
when matched then update set T.LAST_DL_BATCH_SYNCED_REVISION = GREATEST(COALESCE( IL_REVISION, 0), COALESCE(IB_REVISION, 0));
commit
Replace $$DL_NAMES$$ with your Data location name.
You must have grabbed a data location from another environment with pending loads or something so.
You have to pass this query to put it in order:
merge into sem_repository.MTA_INTEG_LOAD T
using (select IL.UUID UUID, IL.REVISION IL_REVISION, IB.REVISION IB_REVISION
from sem_repository.MTA_INTEG_LOAD IL
inner join sem_repository.MTA_DATA_LOCATION DL on (IL.O_DATALOCATION = DL.UUID)
left join sem_repository.MTA_INTEG_BATCH IB on IB.R_INTEGLOAD = IL.UUID
where IL.CLASSNAME <> 'ContinuousLoad' and DL. NAME in ('$$DL_NAMES$$')
and (IL.LAST_DL_BATCH_SYNCED_REVISION is null or IL.LAST_DL_BATCH_SYNCED_REVISION < IL.REVISION or (IB.REVISION is not null and IL.LAST_DL_BATCH_SYNCED_REVISION < IB.REVISION) ) ) S
on (T.UUID = S.UUID)
when matched then update set T.LAST_DL_BATCH_SYNCED_REVISION = GREATEST(COALESCE( IL_REVISION, 0), COALESCE(IB_REVISION, 0));
commit
Replace $$DL_NAMES$$ with your Data location name.
T
Toshish Chauhan
said
9 months ago
The following Error occurs due to Desynchronization between the MTA_INTEG_BATC and MTA_INTEG_LOAD_ and DL_BATCH tables. Probable cause is a loss of connection to the database.
org.springframework.dao.IncorrectResultSizeDataAccessException:Incorrect result size: expected 1, actual 2 at org.springframework.dao.support.DataAccessUtils.nullableSingleResult(DataAccessUtils.java:100) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:237) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:245) at com.semarchy.platform.integration.polling.dlbatch.RepoLoadDao.queryRepoLoad(RepoLoadDao.java:153) at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.checkRepoLoadOptimisticLocking(DlBatchSynchronizer.java:205) at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.lambda$6(DlBatchSynchronizer.java:199) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.lambda$5(DlBatchSynchronizer.java:196) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.synchronizeRepoLoad(DlBatchSynchronizer.java:196) at com.semarchy.platform.integration.polling.dlbatch.DlBatchSynchronizer.synchronizeDlBatchForDesynchronizedLoads(DlBatchSynchronizer.java:111) at com.semarchy.platform.integration.polling.IntegrationLoadDequeuer.dequeue(IntegrationLoadDequeuer.java:514) at com.semarchy.platform.integration.polling.AbstractIntegrationBatchPoller.dequeue(AbstractIntegrationBatchPoller.java:155) at com.semarchy.platform.integration.polling.quartz.QuartzIntegrationBatchPoller.execute(QuartzIntegrationBatchPoller.java:214) at com.semarchy.platform.integration.polling.quartz.QuartzIntegrationBatchPoller$SemarchyJob.execute(QuartzIntegrationBatchPoller.java:240) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Steps to Resolve the issue :-
1. Run this query and see the result ( there will be last_dl_batch_synced_revision Column will be null for some records due to this problem is generated):
innerjoin MTA_DATA_LOCATION DL on (IL.O_DATALOCATION = DL.UUID)
leftjoin MTA_INTEG_BATCH IB on IB.R_INTEGLOAD = IL.UUID
where IL.CLASSNAME <> 'ContinuousLoad'
and (
IL.LAST_DL_BATCH_SYNCED_REVISION isnull
or IL.LAST_DL_BATCH_SYNCED_REVISION < IL.REVISION
or (IB.REVISION isnotnulland IL.LAST_DL_BATCH_SYNCED_REVISION < IB.REVISION)
)
2. After seeing result of above query then go for pending and running batch status by running below query :-
select STATUS, COUNT(*)
from mta_integ_batch
group by status
order by status
;
You should have few of them either in 'RUNNING' or 'PENDING' or 'SCHEDULED' and if the number checked with the error message, run
update mta_integ_batch
where status in ('PENDING', 'RUNNING')
set status = 'ERROR'
3. Some version of PostgreSQL(Merge is not supported till postgres 14 . As Merge is introduced in postgres 15) does not support the MERGE statement .The you can go for update query else you can use merge query if this is supported in your version. Three queries to Sync , you can opt any query.
I. Run the below query and replace ## LE NOM DE TON SCHEMA REPO ## With your Schema Repository Name and ## LE NOM DE TA DATA LOCATION ## with your Data location name.
UPDATE ## LE NOM DE TON SHCEMA REPO ##.MTA_INTEG_LOAD IL
SET LAST_DL_BATCH_SYNCED_REVISION = greatest(
coalesce(IL.REVISION, 0),
coalesce(IB.REVISION, 0))
FROM ## LE NOM DE TON SHCEMA REPO ##.MTA_INTEG_BATCH as IB, ## LE NOM DE TON SHCEMA REPO ##.MTA_DATA_LOCATION as DL
where IB.R_INTEGLOAD = IL.UUID
AND IL.O_DATALOCATION = DL.UUID
AND IL.CLASSNAME <> 'DirectDupsManagementLoad'
and DL.NAME in ('## LE NOM DE TA DATA LOCATION ##')
and (
IL.LAST_DL_BATCH_SYNCED_REVISION is null
or IL.LAST_DL_BATCH_SYNCED_REVISION < IL.REVISION
or (
IB.REVISION is not null
and IL.LAST_DL_BATCH_SYNCED_REVISION < IB.REVISION
)
)
;
II. Run below query ( Replace $$DL_NAMES$$ with your Data location name. ). ( You must have grabbed a data location from another environment with pending loads or something so. You have to pass this query to put it in order ) :-
MERGE INTO mta_integ_load t
USING (
SELECT
il.uuid uuid,
il.revision il_revision,
ib.revision ib_revision
FROM
mta_integ_load il
INNER JOIN mta_data_location dl ON ( il.o_datalocation = dl.uuid )
LEFT JOIN mta_integ_batch ib ON ib.r_integload = il.uuid
WHERE
il.classname <> 'ContinuousLoad'
AND dl.name IN ( '$$DL_NAMES$$' )
AND ( il.last_dl_batch_synced_revision IS NULL
OR il.last_dl_batch_synced_revision < il.revision
OR ( ib.revision IS NOT NULL
AND il.last_dl_batch_synced_revision < ib.revision ) )
) s ON ( t.uuid = s.uuid )
WHEN MATCHED THEN UPDATE
SET t.last_dl_batch_synced_revision = greatest(coalesce(il_revision, 0),
coalesce(ib_revision, 0));
III. For SQL SERVER you can use below query ( You can use this if other query show any error)You need to add your data location name in query :-
WITH SourceData AS (
SELECT
il.uuid AS uuid,
il.revision AS il_revision,
MAX(ib.revision) AS ib_revision -- Prevent duplicate rows by taking the highest revision
FROM mta_integ_load il
INNER JOIN mta_data_location dl ON il.o_datalocation = dl.uuid
LEFT JOIN mta_integ_batch ib ON ib.r_integload = il.uuid
WHERE il.classname <> 'ContinuousLoad'
AND dl.name IN ('DATA LOCATION NAME')
AND (
il.last_dl_batch_synced_revision IS NULL
OR il.last_dl_batch_synced_revision < il.revision
OR (ib.revision IS NOT NULL AND il.last_dl_batch_synced_revision < ib.revision)
)
GROUP BY il.uuid, il.revision
)
MERGE INTO mta_integ_load AS t
USING SourceData AS s
ON t.uuid = s.uuid
WHEN MATCHED THEN
UPDATE SET
t.last_dl_batch_synced_revision =
CASE
WHEN COALESCE(s.il_revision, 0) > COALESCE(s.ib_revision, 0) THEN COALESCE(s.il_revision, 0)
ELSE COALESCE(s.ib_revision, 0)
END;
4.Try again after clearing cache of tomcat If possible :-
Stop Tomcat.
Delete the folder semarchy folder in webapps/
Delete the folder Catalina folder in work/
Delete all logs.
Start the tomcat.
R
Régis L'HOSTIS
said
1 day ago
Notre DBA demande s'il est possible d'avoir des informations complémentaires sur les actions à mener. Cela notamment suite à l'exécution des 2 premières requêtes (résultats ci-dessous).
Subham Dixit
Replace $$DL_NAMES$$ with your Data location name.
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstSubham Dixit
Replace $$DL_NAMES$$ with your Data location name.
Toshish Chauhan
The following Error occurs due to Desynchronization between the MTA_INTEG_BATC and MTA_INTEG_LOAD_ and DL_BATCH tables. Probable cause is a loss of connection to the database.
Steps to Resolve the issue :-
1. Run this query and see the result ( there will be last_dl_batch_synced_revision Column will be null for some records due to this problem is generated):
2. After seeing result of above query then go for pending and running batch status by running below query :-
3. Some version of PostgreSQL(Merge is not supported till postgres 14 . As Merge is introduced in postgres 15) does not support the MERGE statement .The you can go for update query else you can use merge query if this is supported in your version. Three queries to Sync , you can opt any query.
I. Run the below query and replace ## LE NOM DE TON SCHEMA REPO ## With your Schema Repository Name and ## LE NOM DE TA DATA LOCATION ## with your Data location name.
III. For SQL SERVER you can use below query ( You can use this if other query show any error)You need to add your data location name in query :-
WITH SourceData AS (
SELECT
il.uuid AS uuid,
il.revision AS il_revision,
MAX(ib.revision) AS ib_revision -- Prevent duplicate rows by taking the highest revision
FROM mta_integ_load il
INNER JOIN mta_data_location dl ON il.o_datalocation = dl.uuid
LEFT JOIN mta_integ_batch ib ON ib.r_integload = il.uuid
WHERE il.classname <> 'ContinuousLoad'
AND dl.name IN ('DATA LOCATION NAME')
AND (
il.last_dl_batch_synced_revision IS NULL
OR il.last_dl_batch_synced_revision < il.revision
OR (ib.revision IS NOT NULL AND il.last_dl_batch_synced_revision < ib.revision)
)
GROUP BY il.uuid, il.revision
)
MERGE INTO mta_integ_load AS t
USING SourceData AS s
ON t.uuid = s.uuid
WHEN MATCHED THEN
UPDATE SET
t.last_dl_batch_synced_revision =
CASE
WHEN COALESCE(s.il_revision, 0) > COALESCE(s.ib_revision, 0) THEN COALESCE(s.il_revision, 0)
ELSE COALESCE(s.ib_revision, 0)
END;
4. Try again after clearing cache of tomcat If possible :-
Régis L'HOSTIS
Notre DBA demande s'il est possible d'avoir des informations complémentaires sur les actions à mener. Cela notamment suite à l'exécution des 2 premières requêtes (résultats ci-dessous).
-------
uuid | il_revision | ib_revision | loadid | last_dl_batch_synced_revision
------------------------------ --------+-------------+------- ------ +--------+-------------- -----------------
807642f7-63cd-41db-b26c- e803dcf72710 | 56857632 | 57009490 | 6690 | 57009489
a87ff284-323c-43ea-bffb- 1b38a54fdb8d | 56852687 | 56997551 | 6689 | 56997550
95057d49-2fd1-4321-8493- 262e4bd1871d | 56874597 | 56876512 | 6697 |
3b44f799-9d37-471e-8558-91c51bd01aa7 | 56863493 | 57021429 | 6692 | 57021428
95057d49-2fd1-4321-8493-262e4bd1871d | 56874597 | 56877097 | 6697 |
236c1967-5461-4270-bf10 -ee3612dbf101 | 56865472 | 57028799 | 6693 | 57028798
b98740fe-346b-4e99-8a16- 3618203e5fe8 | 56843645 | 56961734 | 6684 | 56961733
9733f268-5597-451f-bafb -b5c0c29e5fbe | 56840013 | 56912945 | 6678 | 56912944
6836fb8f-b2a2-499b-8836 -ee7bc9181994 | 56873201 | 57052703 | 6695 | 57052702
a9fd2eeb-2b5d-451d-831d- fde05cfa6e6c | 56828380 | 56901006 | 6675 | 56901005
982b452a-1a0c-430a-ba68- 1194ecc9d90c | 56845462 | 56973673 | 6685 | 56973672
c049407d-e93c-485a-800a- e1969d760b96 | 56870521 | 57040742 | 6694 | 57040741
7e015769-62c2-418e-a84b -f49f314c5cf9 | 57040723 | 57040722 | 6699 |
d494b0f8-0f1d-46f4-a4f3 -b4b2d5943f2e | 57052588 | 57052587 | 6706 |
f3dd9c37-6963-4dde-b883-6b98af8343b9 | 57043908 | 57043907 | 6700 |
fce80b07-5632-4530-9433- f8eaa5076862 | 57052627 | 57052626 | 6707 |
1632a1a5-03b0-48a0-b631-9a09a7df67fc | 57043945 | 57043944 | 6701 |
bf11b51d-bd29-48ca-bed4-1cb33c77cd68 | 57052716 | 57052715 | 6710 |
d6b6b7dc-8741-4c4c-8363 -f23e7f5f7222 | 57043947 | 57043946 | 6702 |
96552c40-6a97-46b3-969b -e1320f418458 | 57052719 | 57052718 | 6711 |
d6da57d8-844d-4c39-8935 -ef67139d2f42 | 56840353 | 56920315 | 6679 | 56920314
096a8ca4-63dd-465e-bc44 -b0f9fbe2a4b7 | 56840369 | 56954364 | 6683 | 56954363
859ec5d8-cdb3-41f0-b281 -dca7a587803e | 57050341 | 57050340 | 6704 |
f882f9b3-b328-4bda-a82a -ed70f5f7f2c6 | 57052724 | 57052723 | 6712 |
68d3f421-00c5-47a4-8094 -aef217b1e472 | 57050343 | 57050342 | 6703 |
deb9f1b4-222a-46cf-b7bc -afcbc8db61ea | 57052726 | 57052725 | 6713 |
2d273950-8c47-49f8-a1bb- 7ee90615b136 | 56840357 | 56932254 | 6680 | 569322539cc96cac
-bb29-43d0-ad34-6503445644de | 56840361 | 56939624 | 6681 | 56939623195200ab
-3eab-4763-a108-677e8ea5fa9f | 57052729 | 57052728 | 6714 |
098c150b-e4f5-470f-a8c2- 239e8aabbcf3 | 56840365 | 56946994 | 6682 | 56946993
2238fddb-c78a-403b-bd51-785ea6beb2e1 | 57052732 | 57052731 | 6715 |
31c118c7-0286-46c4-bc7c -c5c27af2e5b7 | 57052737 | 57052736 | 6716 |
8a08b470-85b0-4235-a968 -cb4703f6b3ff | 57052739 | 57052738 | 6717 |
fe109b93-9d57-4c27-98dc -d653ec3b4414 | 57052745 | 57052744 | 6718 |
c82571fe-0639-4b85-a8bb -1561ef5e1a96 | 57052747 | 57052746 | 6719 |
1b7c6fce-41e4-4d85-9482- 5400713ff93f | 57052751 | 57052750 | 6720 |
e4a5e2c9-b747-44b4-9658-3a9edff84b48 | 57052753 | 57052752 | 6721 |
69156db9-6e49-4d51-b220 -cf89a84bbb2a | 57052759 | 57052758 | 6722 |
d9c77ba2-f281-4958-975a -4f87c11d7078 | 57052761 | 57052760 | 6723 |
6951b40f-faeb-4a7d-b61b -d96c4fb34849 | 57052765 | 57052764 | 6724 |
baa70ae1-28b9-4153-86c0-67221b8a8f94 | 57052767 | 57052766 | 6725 |
4cbc8ee4-b031-4f85-ac1e- 85e752f4d5f9 | 57052771 | 57052770 | 6726 |
f2ea1ef2-0ffc-4de1-bc09-51660faebda4 | 57052773 | 57052772 | 6727 |
741cb3f0-08b7-42ae-9c37-91737d96126d | 57052778 | 57052777 | 6728 |
244c12a0-57e7-4245-af27-039eed957a44 | 57052780 | 57052779 | 6729 |
01c3cf7e-52f1-4c93-9c98 -ae60ffdebfbe | 57052784 | 57052783 | 6730 |
a29261fe-e72c-48bd -89a3-40f7cf2e4a3e | 57052786 | 57052785 | 6731 |
6552a654-7d45-456f-9d22-3065625bb0d0 | 57052790 | 57052789 | 6732 |
7026f08d-1eda-4937-a335-44283a15d0ba | 57052792 | 57052791 | 6733 |
b7334e34-cddf-420e-91ab -25e6ad96430d | 56851992 | 56985612 | 6688 | 56985611475141ff
-93f8-4e52-8459-9343e2346d4b | 57052708 | | 6708 |
54bd7788-6dda-471f-bc90- e0c41dc57abb | 57052585 | | 6705 |
2a1ec163-d7d3-4741-8af0- 51e949eb05d6 | 57052709 | | 6709 |
124a8312-5089-4103-b026- c8721171161f | 57040721 | | 6698 |
(54 lignes)
semarchy=> select STATUS, COUNT(*)
semarchy-> from repository.mta_integ_batch
semarchy-> group by status
semarchy-> order by status;
status | count
-----------+-------
DONE | 4442
ERROR | 1
PENDING | 32
PRÉVU | 2
AVERTISSEMENTS | 1387
(5 lignes)
-------
Est-ce qu'il y a des actions / précautions à prendre avant de poursuivre avec la modification de données en base ?
Merci pour votre retour.
Subham Dixit
Hello Regis,
You need to follow the Article, after you get the count of records in 'PENDING' or in 'RUNNING' then update it to 'ERROR'.
You can take a backup before proceeding for this but there's not any side affects.
Thank you
-
Deployment History Date
-
Username in Tomcat Access Logs
-
Is It Possible to Perform Automatic Authentication with The User's Windows Account?
-
Where is the documentation for Version 5.2.5?
-
On Prem Semarchy Authentication using Azure AD?
-
Delete old models
-
Sync production model version with dev
-
Recreate a dev environment. Any side effect?
-
Indexes on xDM database tables
-
What logging technology is used in the Semarchy xDM platform?
See all 72 topics