SharePoint - Save Conflict Error

Asked By Jibin Johnson
30-Jan-10 06:52 AM
Hi,

I have a windows forms application which has to upload documents from the file system to a Sharepoint site.Also i have a requirement that i have to run around 5-10 instances of this Win App on the same server instance.
When a case occurs like all the instances of the WinApp upload documents to the same document library,i get the following error.

Save Conflict

Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes.   at Microsoft.SharePoint.Library.SPRequestInternalClass.SetListProps(String bstrUrl, String bstrListName, Boolean bMigrate)


Please find below some parts of the code implemented for uploading of documents.

//check version of document.

if(MajorVersion)
{
         splist.enableminorversions=false;
        splist.update();
        if(fileexists)
       {
              //spfile.checkout;
             splist.rootfolder.files.Add();
             //spfile.checkin as major version;
        }
       else
       {
             splist.rootfolder.files.Add();
        }
        spfile.item.updateoverwriteversion();
}
else
{
        splist.enableminorversions=true;
        splist.update();
        if(fileexists)
       {
            //spfile.checkout;
            splist.rootfolder.files.Add();
           //spfile.checkin as minor version;
        }
       else
       {
               splist.rootfolder.files.Add();
       }
       spfile.item.updateoverwriteversion();
}
splist.update();


Beacuse i have to run multiple instances of the WinApp,i am not able to debug which update is creating the problem exactly.please help me find a solution to this.

  Sakshi a replied to Jibin Johnson
31-Jan-10 02:18 AM

If you retrieve an SPWeb object from the current context (SPContext.Current.Web), you cannot and should not dispose of this.

A good solution is here.


Thanks and Regards,
www.CodeCollege.NET
www.InterviewsGuru.info

  Jibin Johnson replied to Sakshi a
01-Feb-10 01:13 AM

Hi,

Thanks for replying..!!

Actually i am not retrieving the spweb object from the current context.My implementation is in lines with the link you sent.

 using (SPSite spSite = new SPSite("URL"))
{
                using (SPWeb spWeb = spSite.OpenWeb())
                {    }

}

I also ran a SPDisposeCheck,the results were positive indicating the object are being disposed properly.

Is this problem somewhere related to the update events...any deadlock or something?If so any solution for this ..?

Create New Account
help
Forms Library Error SharePoint I've got a SharePoint 2003 forms library that I am submitting an InfoPath form to. It submits correctly the first time, but when someone opens the form and tries to resubmit it, they get the following error: An error occurred while the form was being submitted. The form cannot be submitted to the following overwrite if the file exists. Does anyone know what would cause us to get this error? Thanks SharePoint Discussions SharePoint (1) InfoPath (1) Vance (1) Submits (1) Sens (1) try running
document library error SharePoint Windows 2008 / MOSS 2007 sp1 the tab 'document library' - when I try to open it with Windows Explorer from a client machine, I get an error . But when I try it on the SharePoint Server it works completely fine. Can anyone help me resolve this SharePoint Discussions SharePoint (1) MOSS 2007 (1) Michelangelo (1) Windows (1) Laflour (1) Sp1 (1) WBR (1) Hello
programmatically / command-line upload to sharepoint library SharePoint I have access to a sharepoint document library. I can access it through the web and use the upload GUI (http: / / server:port and for the life of me, I can't figure out how. something on the sharepoint server (such as a web service). I don't have that type of access. All I have access to is the document library. I also notice suggestions to mount the URL using "net use X: \ \ server:port \ path method. This actually returns a "network name cannot be found" error. If I can do it with the Explorer drag / drop, surely it can be accomplished
Drag an inbox email into a Sharepoint Doc Library visible in Outlook Folder List under "Sharepoint Lists" SharePoint If I connect a Sharepoint doc library to Outlook, the library appears in my Outlook Folders list like this: Sharepoint Lists \ Sharepoint Library Name (files in that Sharepoint LIbrary appear here) (Subfoldes in that Sharepoint
the right permissions on the content type. Then, I created a column "external data" in Sharepoint that I linked to my content type. When I want to change the data in this column in a list , for example, an error says: An error occurred when retrieving data " name of the database ." For more information administrators can view the EventID Level Message Correlation 11 / 13 / 2011 00:08:30.31 w3wp.exe (0x1D9C) 0x1038 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Request (GET:http: / / tricoflex:80 / CRM / _layouts / FldNewEx Cust%2E%20Relation%20ID&DescriptionParam = &VldFormulaParam = &VldMessageParam = )) 11 / 13 / 2011 00:08:30.31 w3wp.exe (0x1D9C) 0x1038 SharePoint Foundation Logging Correlation Data xmnv Medium Name = Request (GET:http: / / tricoflex:80 / CRM / _layouts / FldNewEx e307-4c5d-b470-c4351e5dff53 11 / 13 / 2011 00:08:30.32 w3wp.exe (0x1D9C) 0x1038 SharePoint Foundation Logging Correlation Data xmnv Medium Site = / 9694064f-e307-4c5d-b470-c4351e5dff53 11 / 13 / 2011 00:08:30.35 w3wp.exe (0x1D9C) 0x1038 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Request (GET:http: / / tricoflex:80 / CRM / _layouts / FldNewEx e307-4c5d-b470-c4351e5dff53 11 / 13 / 2011 00:08:30.45 wsstracing.exe (0x06A0) 0x17A0 SharePoint Foundation Unified Logging Service b9wt High Log retention limit reached. Log file 'C: \ Program Files