Alfresco Script and long running transactions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2013 01:29 PM
Hi all,
I've tried to search for this topic with no luck (I admit I was not so sure what to look for).
So here is my issue: I've to "adjust" a set of nodes (fixing some properties and move to a different path).
I usually do this with a simple javascript script that uses a lucene query to get the list of nodes and apply the logic I need to apply.
In this case the set of nodes overcome the limit of lucene search, so I've managed to get a csv of uuid from alfresco db. I've developed a script that splits the csv content line by line and apply the logic to each node.
The issue is that if the csv is small (100 lines or so) the script end and everything seem fine; if the csv is big (10000 lines or so) the script seems to end (I can see from the log I added) but it kinda has no effect, like it has not committed any changes.
Do you have any idea on the possible reasons of such a behaviour?
Do you any advice on a different way to implement such a script?
Thanks in advance,
Angelo
I've tried to search for this topic with no luck (I admit I was not so sure what to look for).
So here is my issue: I've to "adjust" a set of nodes (fixing some properties and move to a different path).
I usually do this with a simple javascript script that uses a lucene query to get the list of nodes and apply the logic I need to apply.
In this case the set of nodes overcome the limit of lucene search, so I've managed to get a csv of uuid from alfresco db. I've developed a script that splits the csv content line by line and apply the logic to each node.
The issue is that if the csv is small (100 lines or so) the script end and everything seem fine; if the csv is big (10000 lines or so) the script seems to end (I can see from the log I added) but it kinda has no effect, like it has not committed any changes.
Do you have any idea on the possible reasons of such a behaviour?
Do you any advice on a different way to implement such a script?
Thanks in advance,
Angelo
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2013 06:24 PM
I suggest you look at your error log, I suspect you will find a transacion buffer error (probably says warning but my experience is that it stops doing updates once you hit the warning). If I am correct then you problem is that your javascript is trying to do all the updates in one transaction and running out of transaction buffer space. You need to split it into multiple transactions.
Now, I have had this problem, but never found a way to split a single javascript execution into multiple transactions. I think you can do wthis by executing actions against each record because I believe (only from what I have read) that each action runs in a discrete transaction.
When I encountered this issue, in the end, I wrote a PHP script and did it via CMIS because each CMIS update is executed in a single transaction.
Now, I have had this problem, but never found a way to split a single javascript execution into multiple transactions. I think you can do wthis by executing actions against each record because I believe (only from what I have read) that each action runs in a discrete transaction.
When I encountered this issue, in the end, I wrote a PHP script and did it via CMIS because each CMIS update is executed in a single transaction.
