Increase Connection Timeout


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Good point.  Yes, they should.
Kenneth Langley
Kenneth Langley
StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)
Group: StrataFrame Users
Posts: 26, Visits: 1.5K
Trent

I cannot find any documentation for the push/pull BLOB functions you referenced. Could you please give us a sample or point me to where it is used.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You can go at this a number of ways, but here is a quick sample.  Let's first put a method on the BO where the varbinary field resides:

BO Method

''' <summary>
''' Updates a blob or binary field on a thread with callback methods updating the progress
''' </summary>
Public Sub UpdateBlobData(ByVal pk As Integer, _
      ByVal data As Byte(), _
      ByVal displayText As String, _
                           ByVal progressCallback As BlobProgressDelegate, _
      ByVal completeCallBack As BlobPushCompleteDelegate, _
      ByVal errorCallback As BlobErrorDelegate)
'-- Establish Locals
Dim pkValue As New MicroFour.StrataFrame.Business.PrimaryKeyValue(New Object() {pk})

'-- Start the update progress
Me.PushBlobFieldAsync(pkValue, _
        "FieldName", _
        data, _
        84000, _
        displayText, _
        progressCallback, _
        completeCallBack, _
        errorCallback)
End Sub

In this example, the above field name is "FieldName" so we would add "FieldName" to the FieldsToExcludeFromUpdate and FieldsToExcludeFromInsert.  This way the PK, time stamp columns, etc. would save before we try to save our blob data.  So taking this example, and assuming that you have added the "FieldName" to the FieldsToExclude properties on the BO, the code would look something like this:


'-- Save the BO data to the server minus the blob field.  The Blob field will not be included because
'    it should have been added to the FieldsToExcludeFrom... properties.
MyBO.Save()

'-- Now that all other fields of the BO have been saved, it is time to save the blob data
MyBO.UpdateBlobData(MyBO.PrimaryKeyField, _
                              BlobDataAsByteArray, _
                              "Saving large data", _
                              AddressOf HandlePushProgress, _
                              AddressOf HandlePushComplete, _
                              AddressOf HandlePushError)

''' <summary>
''' Handles the completion of a push of a media item to the serve
''' </summary>
Private Sub HandlePushComplete(ByVal state As Object)
 '-- Place any post push logic here (i.e. update the dialog, start a new update, etc.)
End Sub

''' <summary>
''' Handles an error in the push process
''' </summary>
Private Sub HandlePushError(ByVal ex As Exception, ByVal state As Object)
 MicroFour.StrataFrame.Application.StrataFrameApplication.ShowRedExceptionDialog(ex)
End Sub

''' <summary>
''' Handles the progress of an upload or download from the server
''' </summary>
Private Sub HandlePushProgress(ByVal currentCount As Long, ByVal totalCount As Long, ByVal nextIncrement As Byte(), ByVal state As Object)
 '-- Update the progress
 lblProgress.Text = CType(state, String)
 
 '-- Update the thermo
 Try
     '-- Don't let the progress go above the max value
     If prgProgress.Value > totalCount Then prgProgress.Value = totalCount
 
     prgProgress.Maximum = totalCount
     prgProgress.Value = currentCount
 Catch ex As Exception
 End Try
End Sub

That should give you a good starting point.

Kenneth Langley
Kenneth Langley
StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)StrataFrame Novice (52 reputation)
Group: StrataFrame Users
Posts: 26, Visits: 1.5K
Thanks Trent

We have this working well now, thanks for the help

Kenneth langley

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Cool.  It is cool watching it show the progress while updating a single field, huh?  I still enjoy uploading large files where we have this implemented just so I can watch it progress BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search