|
From: Pieter L. <pie...@be...> - 2022-03-02 07:49:41
|
Hi Mansell,
I am not an expert of the matter, but I can confirm
that*util:document-id#1* returns an error, also when I run your XQuery
on a collection of my own. I suspect that the internal document ID is
not longer an int, and that the function *util:document-id#1* may no
longer be functional.
You could try removing line 21 entirely; if no code is dependent on
*<id>* then you may be fine. I would expect more things to break in
other parts of the code though, as there have been quite a few changes
between 2.2 and 4/5/6.
Best
Pieter
On 01/03/2022 12:48, Mansell, Gary wrote:
> Hi, firstly, apologies - I am a system admin not a developer, so I don't know much about ExistDB and XQuery. I have a System that I need to ugprade to the latest version of ExistDB and I have found that it errors when run in the latest 6.0.1 release.
>
> This is the error when I run the query via a browser:
>
> <exception>
> <path>/db/apps/dwhQueries/getFilesToProcessGrouped</path>
> <message>err:FORG0001 can not convert '[I@6161ddcc' to xs:int [at line 21, column 7, source: /db/apps/dwhQueries/getFilesToProcessGrouped]</message>
> </exception>
>
>
>
> This is the code of the query referenced above (line 21, column 7 is the line with this in it: "util:document-id($x)":
>
> xquery version "3.0";
>
>
> let $allItems := (for $x in collection('/db/apps/dwh1') order by util:document-name($x) ascending return $x)
> let $totalCnt := count($allItems)
> let $toTake := 100
> return
> <filesToProcess>
> <TotalItemsInQueue>{ $totalCnt }</TotalItemsInQueue>
> {
> let $topN := $allItems[position() le $toTake]
> let $returnedItemsCnt := count($topN)
> return
> (<ItemsReturned>{ $returnedItemsCnt }</ItemsReturned>,
> <Files>{
> for $x in $topN
> return
> <file>
> <name>{ util:document-name($x) }</name>
> <uri>{ document-uri($x) }</uri>
> <id>{ util:document-id($x) }</id>
> <Objs>{
> for $item in $x//Part
> group by $id := $item/ID, $type := $item/Type, $operation := $item/Operation, $branch := $item/Branch, $perColID := $item/PerColID, $pnWfProcessID := $item/ProcessID
> return
> <Obj>
> {$id}
> {$branch}
> {$perColID}
> {$type}
> {$pnWfProcessID}
>
> <Count>{ count($item) }</Count>
> { $operation }
> </Obj>
> }</Objs>
> </file>
> }</Files>)
> }
> </filesToProcess>
>
>
> As far as I can understand there seems to be a problem in the new version of ExistDB casting the Document ID to an Int - why would this be when this worked fine in version 2.2. Have some things changed in this area since 2.2?
>
>
> This is the xml file in dwh1 that it is trying to query:
>
>
> 1646127543559_10488.xml
>
> <Parts>
> <Part>
> <ID>1420709307</ID>
> <Branch>1420709306</Branch>
> <Type>wt.part.WTPart</Type>
> <Operation>NEW_VERSION</Operation>
> </Part>
> <Part>
> <ID>1420709308</ID>
> <Type>wt.folder.IterFolderMemberLink</Type>
> <Operation>POST_MODIFY</Operation>
> </Part>
> <Part>
> <ID>1420709304</ID>
> <Type>wt.part.WTPartMaster</Type>
> <Operation>NEW_VERSION</Operation>
> </Part>
> </Parts>
>
>
>
> Any advice/help would be appreciated as I must upgrade ExistDB version for security reasons, yet this error is stopping me.
>
> Thanks
>
> Gary
>
>
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
> This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are
> addressed. If you have received this e-mail in error please notify the sender immediately and delete this e-mail from your system.
> Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those
> of Ricardo (save for reports and other documentation formally approved and signed for release to the intended recipient). Only Directors
> are authorised to enter into legally binding obligations on behalf of Ricardo. Ricardo may monitor outgoing and incoming e-mails and
> other telecommunications systems. By replying to this e-mail you give consent to such monitoring. The recipient should check e-mail and
> any attachments for the presence of viruses. Ricardo accepts no liability for any damage caused by any virus transmitted by this e-mail.
> "Ricardo" means Ricardo plc and its subsidiary companies.
> Ricardo plc is a public limited company registered in England with registered number 00222915.
> The registered office of Ricardo plc is Shoreham Technical Centre, Shoreham-by Sea, West Sussex, BN43 5FG.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> _______________________________________________
> Exist-open mailing list
> Exi...@li...
> https://lists.sourceforge.net/lists/listinfo/exist-open
--
Pieter Lamers
John Benjamins Publishing Company
Postal Address: P.O. Box 36224, 1020 ME AMSTERDAM, The Netherlands
Visiting Address: Klaprozenweg 75G, 1033 NN AMSTERDAM, The Netherlands
Warehouse: Kelvinstraat 11-13, 1446 TK PURMEREND, The Netherlands
tel: +31 20 630 4747
web:www.benjamins.com
|