You are viewing limited content. For full access, please sign in.

Discussion

Discussion

The specified operation is not recognized: error while importing Briefcases usint SDK Toolkit

posted on March 17, 2014

Hello,

 

I'm running a code to import Briefcases using SDK/Toolkit version 8.0

The process is generally working fine, but from time to time it gives the following error:

 

The specified operation is not recognized

 

The importing process stops and I get only part of the content of the Briefcase imported into my Repository.

 

But if I take the same briefcase and import it through the normal LF Client interface, the process is successfully completed.

 

My code is as follows:

 

 

Public Sub Import(ByVal BriefcaseData As IO.Stream, ByRef TargetFolder As LFFolder)
        Try
            Dim importer As New LFBriefcaseImporter
            importer = TargetFolder.ImportBriefcase(db.GetVolumeByName("DEFAULT"))
            Dim request As LFBriefcaseRequest = importer.Start()
            While Not request Is Nothing
                Select Case request.Type
                    Case Briefcase_Request_Type.BRIEFCASE_REQUEST_DATA
                        Dim buffer(request.DataAmount - 1) As Byte
                        Dim AmountRead As Long = BriefcaseData.Read(buffer, 0, buffer.Length)
                        If AmountRead <> request.DataAmount Then
                            Dim SizedBuffer(AmountRead - 1) As Byte
                            Array.Copy(buffer, SizedBuffer, AmountRead)
                            buffer = SizedBuffer
                        End If
                        request = importer.WriteData(buffer)
                    Case Briefcase_Request_Type.BRIEFCASE_REQUEST_FINISHED
                        request = Nothing
                    Case Briefcase_Request_Type.BRIEFCASE_REQUEST_MATCH_TEMPLATES
                        request = importer.SetMatchTemplates()
                    Case Briefcase_Request_Type.BRIEFCASE_REQUEST_SEEK
                        Select Case request.SeekOrigin
                            Case Seek_Origin.SEEK_ORIGIN_CUR
                                BriefcaseData.Seek(request.SeekOffset, IO.SeekOrigin.Current)
                            Case Seek_Origin.SEEK_ORIGIN_END
                                BriefcaseData.Seek(request.SeekOffset, IO.SeekOrigin.End)
                            Case Seek_Origin.SEEK_ORIGIN_SET
                                BriefcaseData.Seek(request.SeekOffset, IO.SeekOrigin.Begin)
                        End Select
                        request = importer.FinishedSeek()
                    Case Briefcase_Request_Type.BRIEFCASE_REQUEST_TELL_POSITION
                        request = importer.TellLocation(BriefcaseData.Position)
                    Case Briefcase_Request_Type.BRIEFCASE_REQUEST_WAIT
                        request = importer.FinishedWait()
                    Case Else
                        request = Nothing
                End Select
            End While

        Catch ex As Exception
            Log(Now & " Error importing Briefcase = " & Err.Description)
        End Try
End Sub

 

I searched the Support site but couldn't find any relevant information.

 

Could you please help?

 

Thank you and best regards,

 

Ignacio PdeA

BMB sal

0 0
replied on March 27, 2014

Thanks Robert for your advice!

I will try and see if the db.rootfolder solves the issue.

Unfortunately it is a little hard to upgrade all their system to v9 in the short term, but surely this will happen sooner or later.

Have a nice day!

Ignacio PdeA

0 0
replied on March 27, 2014

Just to clarify, some of the bug fixes he is refering to is specifically in the 8.0 (as opposed to 8.1, 8.2, etc...) SDK libraries. Even if you aren't able to go to 9.0, if you are on a later version of v8 you can use later versions of the SDK libraries and get some of the fixes.

0 0
replied on March 19, 2014

I don't see anything obviously wrong with the code. Look for a briefcase import log in the repository's LOGS directory, it might reveal why the import is being cancelled. Also, can you upgrate to a newer version of the SDK? There have been numerous bug fixes in briefcase import since the 8.0 release. The server version needs to be the same or newer version as the SDK you are using.

 

I have a theory about what might be happening: If the briefcase import takes more than a couple minutes, your LF session might be timing out, which causes the import to be cancelled. There is a background thread in LFSO that pings the server to keep the session alive, but this was somewhat buggy in 8.0. To test this, below "While Not request Is Nothing" try adding "db.GetRootFolder()" to make a request to the server, which will keep the session from timing out.

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.