Lightroom processes for ages after withProlongedWriteAccessDo

Hi,
I am considering a switch from Expression Media to Lightroom, and I wrote for that a Lightroom plugin that imports all my metadata from an EM XML file. Functionaly, it works great.
However, I have a performance issue problem: if I run the plugin on my whole photo collection (>30.000 items), then Lightroom gets crazy with the CPU and the memory after once my code returns.
The processing time seems exponential. If I run the plugin with 1.000 items, the return is almost instantaneous. On 5.000 items, it takes several minutes. With 30.000 items, it still wasn't finished after 30min, I killed Lightroom.
My guess is that Lightroom does some kind of post-processing, or maybe that's because Lightroom prepares the "undo".
Is that a known problem ?
Here is the skeleton of my code. Once doStuff2 returns, Lightroom does who knows what, and then doStuff returns too. This time seems exponential with the number of database changes my code causes.
function doStuff2(context, progress)
     local catalog = LrApplication.activeCatalog()
     local photos = catalog:getTargetPhotos()
     parseXml()
     for completed, photo in ipairs( photos ) do
          if progress:isCanceled() then return end
          photo:addKeyword(...)
          setMetadata(...)
end
function doStuff()
     local catalog = LrApplication.activeCatalog()
     catalog:withProlongedWriteAccessDo(
               title="Import from Expression Media",
               func=doStuff2,
               caption="Initializing plugin",
               pluginName="Expression Media Import",
               optionalMessage = "The plugin will first read your Expression Media XML file and then import the data into Lightroom for "
                    .. ( # catalog:getTargetPhotos() ) .. " photos"
end
import 'LrTasks'.startAsyncTask( doStuff )

Very possibly.
I've been really stoked with my new multi-phase catalog accessor - strongly recommend writing something like it for yourselves (see source code in other thread, or contact me for fresh stuff).
Here's an example from my most recent plugin:
local s, m = cat:update( 10, "Assure Folder Collection Set", function( context, phase ) -- 10 is seconds to get in.
    -- function can take parameters, but not used here.
    if phase == 1 then
        set = catalog:createCollectionSet( folder:getName(), parent, true )
        return false -- keep going
    elseif phase == 2 then
        leafPhotos = folder:getPhotos(false)
        if #leafPhotos > 0 then
            return false
        else
            return true -- done
        end
    elseif phase == 3 then
        coll = catalog:createCollection( str:fmt( '[^1]', folder:getName() ), set, true )
        app:logVerbose( "Created/assured \"Folder Leaf Photos\" collection ^1 in '^2'", folder:getName(), set:getName() )
        return false
    elseif phase == 4 then
        local collPhotos = coll:getPhotos()
        if #collPhotos > 0 then
            local collPhotoSet = tab:createSet( collPhotos )
            for i, photo in ipairs( leafPhotos ) do
                if not collPhotoSet[photo] then
                    toAdd[#toAdd + 1] = photo
                end
            end
        else
            toAdd = leafPhotos
        end
        if #toAdd > 0 then
            coll:addPhotos( toAdd )
        end
        return true
    end
end )
Note: each phase is a new transaction.
In your case Oliver:
local keyword
local children
local s, m = cat:update( 10, "Keyword business", function( context, phase )
     if phase == 1 then
          keyword = catalog:createKeyword( "Test", {}, true, nil )
          return false -- continue to 2nd phase.
    elseif phase == 2 then
          children = keyword:getChildren()
          -- do something to catalog with children
          return true -- or nil.
     end
end )
This would not make sense if nothing further involved catalog writes (in which case just exiting a simple single-phase with-do method would suffice), but you get the idea, no?
R

Similar Messages

  • Approval process for requisitions after RFQ

    Hi there
    We are using the classic scenario to purchase items.  In many cases these items require an RFQ process to be followed to determine vendor and price.  The business requires that after a price change the initial shopping cart is updated and if the price is significant it goes through re-approval.  Has anyone got any suggestions on how this could be done cleanly in the system?
    My one thought is to combine the SC and P Req approvals - and final approval only occurs when the RFQ is complete and the correct information is added to the SC.  Is this possible?
    The business will not accept change release procedures on the purchase requisition due to high maintenance. 
    Thanks
    Roz

    Hi Venkatesh,
    1) Is it possible to read comments in UWL on a button Click? Is there any API available to achive this?
    Ans: There are no APIs as fas as I know. Normally you see comments after clicking the feedback button in the approvers inbox.
    2) If I store this comments in a repository, how can I set approver for that comment?. (Because approver is varying for each respository)
    Ans: You are having different reps on the basis of different criteria. Take this criteria also as input from user in the comment input form and place the comments in separate comment repositories.
    3) If Comments gets approval, it is needed to be display in comments column in KM Navigation iView.Is it Possible?
    Ans: I suggest you to make your own navigation iview having the "comments" column (or check if there is some configuration required to show comments on docs in a rep). You have to device a way for catching the "Approve" event and then make the contents of Comment repository visible in the navigation iview.
    Please see this [blog|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1424].
    I know this is a complex solution.
    But, this is all what I have got.
    Hope it helps.
    Regards,
    Sumit

  • IS-U: Separate dunning processes for contracts after move out?

    Hi all,
    we are working with IS-U (water, wastewater etc.). After a move-out has been created, the dunning process changes for the whole contract account (VK), as defined in the Customizing area.
    The problem is - if only one contract out of 2 or 3 has to be ended, the dunning process changes for all of them and not only for the one that really has ended. This leads to wrong letters to the customers and a high amount of complaints.
    I found out that there is a new table entry VKKVKP-UMZMAHNV, but as far as I could find out, this changes the dunning process only for a whole VK, too.
    Does anyone of you have had similar problems and could give me a hint?
    Best Regards,
    Stefanie

    Hi Stefanie,
    You can use FM ISU_S_CONTRACT_CHANGE for the purpose to update the Dunning Procedure at contract level using BOR Object MOVEOUTDOC.
    Thanks,
    Amlan

  • "Error in Process" for POs after changing Tax codes and Vendor address

    All,
    We are in extended classic scenario and we have 2 POs with status "Error in Process"
    PO 1:
    The PO was ordered with 3 line items, Confirmed, Inovoiced. Later our accoutnig team realized there should not be tax for one of the line item in the PO. So they created Credit memo and asked our purchasing dept. to change PO from Taxable to Tax except.
    Now the porblem is, when PO chages to tax except in SRM, it is going to "Error in Process".
    What could be the reason?
    PO 2:
    The PO have 10 line items and Confirmed, No invoice is generated.
    Now the Purchsing want to change vendor address in the PO, they changed the vendor address in the PO.
    Now the porblem is, when PO changes in SRM, it is going to "Error in Process".
    I checked the RZ20 Traansaction in SRM, both POs have same errors:
    Backend application errors "Indicator for GR-based invoice verification used not allowed"*
    We removed 'Confirm Performance of Service/Goods Receipt' tick mark for the PO in SRM under follow on documents and it is throwing error saying it must be checked.
    Did any one got this error, what i need to check for this errors?. any help?
    Thanks
    Rams

    Hi,
    Once the PO is created . Confirmation made and invoice .Tax change will not be allowed.
    First reverse the Invoice.
    Cancel the confirmation
    then change in the P.O
    Do the Confirmation and invoice it will allow
    Regards
    G.Ganesh Kumar

  • ABAP MESSAGE_TYPE_X -DUmp Due to Change in hiring process for HK ?

    Hi,
    I changed the Hiring process , just added new infotype 0105 into the process for HK , after that i got an ABAP  "MESSAGE_TYPE_X" dump when i tried to save PA30 .
    See the below Error :
    with the key 50002134567880       9999123119712134256206528473C_VBA in
    table PA0342. It is possible that the record does not exist. The
    following are a few of the possible causes for this:
    o   The code in table PA0342 is not correctly specified in the data
        dictionary (SE11). Compare with another PAnnnn table.
    o   An infotype may have an additional view infotype for which the
        record is not available. This situation can occur when system
        settings for infotype views (T582V) are changed.
    o   Problems with database.
    o   There may be other causes.

    Try running the report rpu03420 for that pernr. Anyway 0342 is an infotype specific to HongKong.
    ~Suresh

  • Safari blank page or loading for ages and then timeout!

    Hi, this is my first topic so please any reply would be much appreciated. I had a week holiday when my Mac was switched off. Before that I havent noticed any problem with it, everything was working fine and fast. I came back on the 1st, had some updates installed on the 2nd and since then I barely can search the web. The pages loading for ages, after that sometimes get info that Im not connected to the web or timeout or the server doesnt respond to that website. BUT my Skype is still fine I even had a two way video call and was perfectly working. 1st I thought it was Safari so I downloaded Mozzilla but I had the same issue with that. Sometimes Safari works ok for a while and then all of a sudden just try to go to another page from what I used and was ok and that new page just doesnt load. I emptied the cache, I reset Safari and after that my topsites never work again. Well not never but once I used something from there I will not be able to go back and use another one. Since the reset I cant even see all the icons in my TOPSites. This problem is killing me now, dont really now what to do, this is my first Mac and I bought it last october. Still have plenty to learn.
    My Safari version is 4.0.5.
    thanks

    HI and Welcome to Apple Discussions...
    Since you have already emptied the cache and reset Safari...
    Go here for trouble shooting 3rd party plugins or input managers which might be causing the problem. Safari: Add-ons may cause Safari to unexpectedly quit or have performance issues
    Right or control click the Safari icon in the Applications folder, then click: Get Info In the Get Info window click the black disclosure triangle next to General so it faces down. *Make sure Safari is NOT running in Rosetta.*
    

Web pages now include a small icon or 'favicon' which is visible in the addrMss bar and next to bookmarks. These icons take up disk space and slow Safari down. It is possible to erase the icons from your computer and start fresh. *To delete Safari's icon cache using the Finder, open your user folder, navigate to ~/Library/Safari/ and move this file "webpageIcons.db to the Trash.*
    If you still have problems with Safari, go to the Safari Menu Bar, click Safari/Preferences. Make note of all the preferences under each tab. Quit Safari. Now go to ~/Library/Preferences and move this file com.apple.safari.plist to the Desktop. Relaunch Safari. If it's a successful launch, then that .plist file needs to be moved to the Trash.
    Carolyn

  • I can no longer open any attachments that are sent to me. I click on and get cannot preview (but have had this for ages). I am clicking on download and nothing happens. It does not download. I clicked to install a new version after updating and clicking r

    I can no longer open any attachments that are sent to me. I click on and get cannot preview (but have had this for ages). I am clicking on download and nothing happens. It does not download. I clicked to install a new version after updating and clicking repair. But still the attachments won't open including invoices I have received today. It is all attachments not just pdfs.

    Angela Richens wrote:
    It is all attachments not just pdfs.
    Then most likely it is not caused by Adobe Reader.
    Anyway, perhaps someone has some idea, if you give us some details: operating system, browser, email client, ...

  • Process for return of Components after sales

    Dear Gurus,
    Plz inform regarding the following process:
    We require a process for return of the components ( part of the Finished goods that is sent to the customer) after the same is being returned by the customer  and then that needs to be replaced by a new part. Please inform how to take the material back in our stock and send a replacement in respect of the same.
    regards
    PUB

    Hi,
    Are you trying to say that first you sell material to the customer.
    Then your customer returns that material and then you do the modification to the material.
    And again send that material to the same customer.
    Is this what you are trying to say.
    But what about the price where you want to accommodate your pricing.
    The material which you are sending after rework is it free of charge delivery or you are charging some amount.
    You can do the process as follow
    Sales order u2013 delivery u2013 billing document u2013 return order wrt billing document u2013 done the PGR.
    Now create new sales order for the newly created material after rework.
    You have to create the sales and distribution BOM for your new sales order.
    In that you can give the details about the return material also.
    So that BOM will be exploded in the newly created order.
    And the pricing you can do as per you want.
    If its not working then please explain us the whole scenario for the better reply.
    Regards
    Raj.

  • After installing, why is lightroom asking for a serial number, when I am a CC subscriber

    after installing, why is lightroom asking for a serial number, when I am a CC subscriber - I am logged in to my CC account

    I have the same issue. I downloaded for my 30 day trial. My time was up, I started my CC subscription and I'm still prompted for a serial number.

  • I purchased and downloaded Lightroom 5.5. After installing it, I was prompted for the serial number. When I entered it an error message appeared saying it was an upgrade serial number and I need to enter my original purchase number. This was my original p

    I purchased and downloaded Lightroom 5.5. After installing it, I was prompted for the serial number. When I entered it an error message appeared saying it was an upgrade serial number and I need to enter my original purchase number. This was my original purchase, not an upgrade. Now what do I do?

    It sounds like you bought an upgrade from Adobe. How much did you pay? The upgrade is about $80, and the non-upgrade is about $150. If you bought an upgrade version and had no previous version, you would see what you're seeing.
    If that is the case and I were you, I'd call Adobe, and arrange for a refund and to order the correct version.
    Hal

  • Can anyone recommend a process for moving just my OS and Adobe Photoshop and Lightroom to the SSD?

    I have an early 2011 MBP running Mountain Lion. I just removed the superdrive and added an SSD. I want to use it to boot from and also run Photoshop and Lightroom from. Can anyone recommend a process for moving my OS and those programs to the SSD?

    I'm assuming your doing this because of data you don't want pernament on the SSD as they can' be scrubbed like hard drives can.
    Disconnect any other drives.
    1: Format the SSD 1 partition, click the box, option GUID and OS X extended journaled as the format.
    2: Download Carbon Copy Cloner.
    3: Clone your MacintoshHD partition to a blank powered external drive also formatted the same as above.
    4: Hold option/alt key and boot the machine (wired or built in keyboard) and then select the clone to boot from,
    5: Once in the clone, click it's drive name and change the name if it's the same as the OS X boot volume.
    6: On the clone, head to System Preferences > Accounts and create a new Admin account.
    7: If you need to move files between accounts on the clone, see this. Combine two+ Users Accounts on the same machine   (be careful that your selecting the correct clones other account)
    8: Once your moving files on the clone is complete, then log into the new user account and delete the old user account.
    9: Use Carbon Copy Cloner to clone the clone to the SSD.
    10: Use Disk Utiltiy to repair permissions on all drives.
    The SSD should be moved to the HD slot and the HD to the optical slot and used as a file drive.
    CCC has a option to not include certain folders like the other user account you don't want, however I tend not to recommend things that are not too far out of line with Apple's ways of doing things as it usually results in bad things occuring. Somewhere in OS X it's recorded of that other user account, so it might still show up in logins and such.
    Also you may want to transfer some files to the other account, so that's why I recommend this method.
    Good Luck

  • Hi I update my I Phone 3 GS for IOS 6.1. but he asking activate Iphone after we process for activation he shown error. please do the needfull

    hi I update my I Phone 3 GS for IOS 6.1. but he asking activate Iphone after we process for activation he shown error. please do the needfull

    Try to restart or - if necessary - to restore the iPhone: 
    See this document:  iPhone: Troubleshooting activation issues
    Disable your Firewall and Antivirus software - it may be blocking the access to the server. Wait a day, maybe the server is down.
    If your iPhone cannot be activated, because it has been modified, we cannot help, see:  http://support.apple.com/kb/HT3743

  • Any way to find out the backend still in Process for the record after saved

    once after we create a record and save here we are using many procs and functions from backend, after the record saved is there any way we will know still the backend is still in process for that record to insert into concerned tables for that module?
    we are getting an error after the first record is saved for some reason the form is not getting clearing after the record is saved there is clear_form code is also there in my save button.
    this is my prod problem please do help me out..
    thanks in advance..

    The Commit will not return control to the form until it is finished. So unless you are starting asynchronous operations with things like DBMS_JOB it is not going to be a timing problem.

  • TM stops after 170 KB, TM prepares for ages, TM stops with error

    Here's another one:
    TM stops after 170 KB, TM prepares for ages, TM stops with error
    I've had it all - after some successful backups. Now I can't make any; error messages ("could not complete because an error has occurred" - thank you very much, Apple, for that most helpful explanation).
    Apple turns us all into beta testers! Another product that is shipped long before it's ready due to marketing strategies - and customers are the idiots.
    I agree: +Don't use TM!+

    I had a very similar problem a few months ago. I spent several days troubleshooting it. Try disabling TM and see if the Finder stops freezing. You might need to wait two or three days to find out. Then try disconnecting your external disk drives and see what happens after another two or three days. I traced my problem back to a Western Digital external disk drive, so I contacted Western Digital via their web site. The next day, they emailed me directions on how to update the disk drive's firmware. I did the update and the problem went away.

  • I'm losing LIghtroom processing changes when opening photo in Photoshop.  Why?

    I have been using Lightroom only for a couple of weeks.  For several years I used Bridge and Camera Raw for RAW file processing.  After noticing that every .DNG file I process in LIghtroom 5.4 and subsequently open in Photoshop-CS4 loses the Lightroom processing in Photoshop, I conducted the following experiment:
    A  .dng file that had not previously been in LR catalog was placed in folder as Original  DNG.dng.
    File was copied and named Lightroom Processed.dng
    Both files were imported into LR
    The Lightroom Processed.dng file was loaded into Develop module and Exposure set to +5.00.  (Note that original is underexposed by about 1 stop and at +5 the photo is almost completely washed out.)
    Lightroom Processed.dng was opened in Photoshop-CS4. (There was no prompt for "Edit a copy with  Lightroom adjustments".  I'm assuming it was because it was a .dng file.)  The original underexposed version was displayed is PS.  When Ctrl-S was used to save the file, a file entitled Lightroom Processed-Edit.tif was automatically saved in the same folder and imported into LR.
    I copied the Develop Settings from Lightroom Processed.dng to LIghtroom Processed-Edit.tif and the numeric exposure setting was displayed as +5.00 BUT there are slight differences in appearance and in the histogram for the .dng and .tif versions.  The .tif version is very slightly darker than the .dng version.
    I opened LIghtroom Processed-Edit.tif in PS.  This time I was prompted to "Edit a copy with Lightroom adjustments" along with the other two options for opening a copy without adjustments or opening original. I selected "Edit a copy with Lightroom adjustments".
    I can't believe that one cannot process a raw file in Lightroom and then open it in Photoshop without having the processing one does in Lightroom carry over into Photoshop.  I've never had this problem using Bridge and Camera Raw.  What am I doing wrong?
    Thanks in advance to all who can help with this problem.

    @willard, moving from a Photoshop Bridge-ACR workflow to an Lightroom workflow there are a couple important differences to be aware off.
    a. ACR/Bridge uses .xmp sidecars to read and write changes to raw files(in the case of DNG files the .xmp data is stored within the file header). ACR/ Bridge cannot read the data stored in the Lightroom Catalog. The info is in the file.
    b. Lightroom by default uses a Catalog file to read and write all that you do in Lightroom. The info is in the Catalog. There is also the option to have Lightroom also write info to a sidecar .xmp file or within the file header of DNG, TIFF or JPG files. This can also be achieved by using the CTRL/CMD-S.  This info in the .xmp or DNG files is used by ACR/Bridge.
    c. In your case the xmp data written by LR 5 which uses the equivalent of ACR 8.4 will not be fully understood by PS CS4 which uses ACR 5.x.
    d. So if you open a DNG file directly in PS CS4 there will not be full compatibly. (you may have requested Lightroom to write to the DNG file but PS CS4 cannot read it all)
    Quote "(There was no prompt for "Edit a copy with  Lightroom adjustments".  I'm assuming it was because it was a .dng file.) "
    In the Lightroom Preferences General tab> Prompts> select Reset all warning dialogs.

Maybe you are looking for

  • Is It Possible to Embed a PayPal Button with HTML Code and Not Widget?

    I noticed that Muse doesn't have a PayPal Subscribe button for monthly payments. PayPal can give me HTML code to embed the button in the website. Will the HTML code work if I embed it with Muse?

  • Transfering metedate from TIFF to RAW

    I have gone through loads of my TIFF files and added metadate/file info - mainly keywords and IPTC details. I now realise I should have added this information directly to my RAW files (.CR2 files), and then converted them to TIFFs with this info incl

  • Multimedia audio controller

    Hello I have a compaq presario SR1130UK and had to put a new hard drive in, everything is working fine other than the multimedia audio controller which has a yellow question mark next to it. This website will recognise my PC but says that it can't ch

  • HT4623 how to reverse ios 6 software update?

    How to reverse ios 6 software update??

  • Buy Muse Adobe as a single app

    Hello,I would like to know if I buy Muse Adobe as a single app in creative cloud, is allow Prosite this plan? Or I have to buy another plan to get access to Behance Prosite. Thank you in advance