Enough with Connection Lost or Time out issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dorandoran
    New Member
    • Feb 2007
    • 145

    Enough with Connection Lost or Time out issue

    I tried infinite timeout (stub.timeout = -1) and long time out (stub.timeout=3 6000000) but I cant seem to take care of the connection issue.

    VERY VERY VERY FRUSTRATED. THIS IS GOING TO BE OVER A MONTH AND NOTHING SEEMS TO BE WORKING.

    HERE IS THE CODE
    <link removed>
    Edit by Mod: Your link was broken anyway. If you want to post your code, post it in the thread using CODE tags


    I WOULD TRULY TRULY TRULY APPRECIATED IF SOMEONE CAN PLEASE TRULY HELP ME RESOLVE THIS ISSUE.

    JULIE JONES
    Last edited by Curtis Rutland; Aug 21 '08, 04:52 AM. Reason: Removed Link
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Do not post in all caps.

    As a member, you should have read the Posting Guidelines by now. If you look in the section Things that are Generally Unacceptable you will see that posting in all caps is considered yelling and very rude. Please refrain from this in the future.

    Also, I removed your link. It 404ed, but even so, post your relevant code in the thread using CODE tags.

    MODERATOR

    Comment

    • dorandoran
      New Member
      • Feb 2007
      • 145

      #3
      1. That reply did not help. I really dont have time and patience for a long lecture. I know the rules. My caps arent used for yelling, it was meant to display my own frustration with time-out issue.

      2. Please only reply to post related and NOT any advice that I really dont care cause I am under a thunder of frustration.

      Thanks
      Julie

      Comment

      • dorandoran
        New Member
        • Feb 2007
        • 145

        #4
        Code:
           Public Function syncSlipNew(ByVal SlipSessionID As String) As Integer
                Try
                    Dim stub As New com.openShine.[url]www.OAirServiceHandlerService([/url])
                    stub.SessionHeaderValue = New SessionHeader()
                    stub.SessionHeaderValue.sessionId = SlipSessionID
                    stub.Timeout = 60000
                    'Dim newTO As New com.openShine.[url]www.OAirServiceHandlerService([/url])
                    'newTO.Timeout
                    Dim myConnection As New SqlConnection
                    myConnection.ConnectionString = (My.Settings.mySQLConnString.ToString())
                    Dim myReader As SqlDataReader
                    Dim myCommand As New SqlCommand("select maxofupdated from view_slips_max_update")
        
                    myCommand.Connection = myConnection
                    myConnection.Open()
                    myReader = myCommand.ExecuteReader
                    myReader.Read()
        
                    'if Local table has data then get the max of update field and compare with remote data. 
                    If myReader.HasRows Then
                        Dim intYear, intMonth, intDay, intHour, intMinute, intSecond As Integer
                        Dim maxUpdated As DateTime
        
                        maxUpdated = DateTime.Parse(myReader("maxofupdated").ToString)
                        'maxUpdated = "7/10/2008  9:32:35 AM"
        
                        intYear = DatePart(DateInterval.Year, maxUpdated)
                        intMonth = DatePart(DateInterval.Month, maxUpdated)
                        intDay = DatePart(DateInterval.Day, maxUpdated)
                        intHour = DatePart(DateInterval.Hour, maxUpdated)
                        intMinute = DatePart(DateInterval.Minute, maxUpdated)
                        intSecond = DatePart(DateInterval.Second, maxUpdated)
                        myConnection.Close()
        
                        Dim read As New ReadRequest()
                        Dim [uAttr] As New Attribute()
                        [uAttr].name = "filter"
                        [uAttr].value = "newer-than"
                        read.type = "Slip"
                        read.method = "equal to"
                        read.fields = "id, updated,  customerid, projectid, projecttaskid, categoryid, userid, date, type, rate, total, decimal_hours, minute, slip_stageid, description, invoiceid, notes"
                        read.attributes = New Attribute(0) {uAttr}
        
                        Dim uDate As New oaDate()
                        uDate.year = intYear
                        uDate.month = intMonth
                        uDate.day = intDay
                        uDate.hour = intHour
                        uDate.minute = intMinute
                        uDate.second = intSecond
        
                        read.objects = New oaDate(0) {uDate}
                        Dim Results() As ReadResult = stub.read(New ReadRequest(0) {read})
        
                        If Results.Length = 0 Then
                            MsgBox("Tables are up to date. Sync is not needed.")
                            Exit Function
                        End If
        
                        Dim dts As Data.DataTable
                        dts = readSlip_Data() 'calling function to get sqlserver slip data
        
                        Dim result As ReadResult
                        Dim objSlip As oaSlip
                        Dim errObj As oaError
                        Dim slipid As Long
        
                        Dim cf As New oaCustomField()
                        Dim customread As New ReadRequest()
                        Dim customresults As ReadResult()
        
                        Dim i As Int32 = 0I
        
                        For Each result In Results
                            ' any errors
                            If result.errors IsNot Nothing Then
                                For Each errObj In result.errors
                                    MsgBox("error: " + errObj.text + " " + errObj.comment + " " + errObj.code)
                                Next errObj
                            End If
        
        
                            Dim row As DataRow
                            ' loop through objects
                            If result.objects IsNot Nothing Then
                                For Each objSlip In result.objects
                                    slipid = objSlip.id
                                    row = dts.Rows.Find(slipid.ToString())
        
                                    If row Is Nothing Then
                                        'No row found in Sql server table so
                                        'Insert routine here 
        
                                        Try
                                            Dim myConn As New SqlConnection
                                            myConn.ConnectionString = (My.Settings.mySQLConnString.ToString())
                                            Dim mCommand As New SqlCommand("Insert into dbo.slip(id, updated, customer_id, project_id, project_task_id, category_id, user_id, date, Type, rate, hour, minute, slip_stage_id, notes, description, invoice_id, cf_update) values ('" & objSlip.id & "','" & objSlip.updated & "', '" & objSlip.customerid & "','" & objSlip.projectid & "','" & objSlip.projecttaskid & "','" & objSlip.categoryid & "','" & objSlip.userid & "','" & Replace(objSlip.date, "0000-00-00 0:0:0", "") & "','" & objSlip.type & "','" & objSlip.rate & "','" & objSlip.decimal_hours & "','" & objSlip.minute & "','" & objSlip.slip_stageid & "','" & Replace(objSlip.notes, "'", "`") & "','" & Replace(objSlip.description, "'", "`") & "','" & objSlip.invoiceid & "','1')", myConn) ' Replace(strValue, "'", "''")
                                            Dim ra As Integer
                                            myConn.Open()
        
                                            ra = mCommand.ExecuteNonQuery()
                                            'MessageBox.Show("New Row Inserted" & ra)
                                            myConn.Close()
        
                                            'Updating custom field for the row just being added to the table
                                            Dim upd_date As New DateTime
                                            upd_date = DateTime.Parse(objSlip.updated)
        
                                            cf.type = "slip" ' custom field association table. project table for this case
                                            cf.id = slipid  ' actual record id from slip table
        
                                            customread.method = "custom equal to"
                                            customread.type = "slip"
        
                                            customread.objects = New oaBase() {cf}
                                            customresults = stub.read(New ReadRequest() {customread})        ' returns name/value pairs.
        
                                            If customresults.Length = 1 Then
                                                Dim customresult As ReadResult
                                                Dim objcf As oaCustomField
                                                Dim customerror As oaError
        
                                                For Each customresult In customresults
                                                    If customresult.errors IsNot Nothing Then
                                                        For Each customerror In customresult.errors
                                                            MsgBox("error: " + customerror.text + "  " + customerror.code + "  " + customerror.comment)
                                                        Next
                                                    End If
        
                                                    If customresult.objects IsNot Nothing Then
                                                        For Each objcf In customresult.objects
                                                            If objcf.name = "adder_charge" Then
                                                                If objcf.value <> "" Then
                                                                    update_cf_slip(slipid.ToString(), objcf.value, upd_date, objSlip.total)
                                                                End If
                                                            End If
                                                            If objcf.name = "retainage_charge" Then
                                                                If objcf.value <> "" Then
                                                                    update_cf16(slipid.ToString(), objcf.value, upd_date, objSlip.total)
                                                                End If
                                                            End If
        
                                                        Next objcf
                                                    End If
                                                Next customresult
                                            End If
                                        Catch ex As Exception
                                            MessageBox.Show(ex.Message)
                                        End Try
                                    Else
        
                                        'MessageBox.Show("found-1")
                                        Dim upd_date As New DateTime
                                        Dim stage_date As New DateTime
                                        upd_date = DateTime.Parse(objSlip.updated)
                                        'If DateTime.Parse(row("updated")).ToString Is System.DBNull.Value Then
        
                                        'End If
                                        stage_date = DateTime.Parse(row("updated"))
                                        If DateTime.Compare(upd_date, stage_date) <> 0 Then
                                            'MessageBox.Show("found - date")
                                            '---------------------
                                            cf.type = "slip" ' custom field association table. project table for this case
                                            cf.id = slipid  ' actual record id from slip table
        
                                            customread.method = "custom equal to"
                                            customread.type = "slip"
        
                                            customread.objects = New oaBase() {cf}
                                            customresults = stub.read(New ReadRequest() {customread})        ' returns name/value pairs.
        
                                            If customresults.Length = 1 Then
                                                Dim customresult As ReadResult
                                                Dim objcf As oaCustomField
                                                Dim customerror As oaError
        
                                                For Each customresult In customresults
                                                    If customresult.errors IsNot Nothing Then
                                                        For Each customerror In customresult.errors
                                                            MsgBox("error: " + customerror.text + "  " + customerror.code + "  " + customerror.comment)
                                                        Next
                                                    End If
        
                                                    If customresult.objects IsNot Nothing Then
                                                        For Each objcf In customresult.objects
                                                            If objcf.name = "adder_charge" Then
                                                                If objcf.value <> row("custom_17").ToString Then
                                                                    update_cf_slip(slipid.ToString(), objcf.value, upd_date, objSlip.total)
                                                                End If
                                                            End If
                                                            If objcf.name = "retainage_charge" Then
                                                                If objcf.value <> row("custom_16").ToString Then
                                                                    update_cf16(slipid.ToString(), objcf.value, upd_date, objSlip.total)
                                                                End If
                                                            End If
                                                        Next objcf
                                                    End If
                                                Next customresult
                                            End If
        
                                            '----------------------
                                            ' updating other fields in SLIP
                                            Dim uRead As New ReadRequest()
                                            uRead.type = "Slip"
                                            uRead.method = "equal to"
                                            uRead.fields = "id,  updated, slip_stageid, type, rate, hour, minute,  total, cost, customerid, projectid,invoiceid, projecttaskid"
                                            Dim uSlip As New oaSlip()
                                            uSlip.id = slipid
        
                                            uRead.objects = New oaBase(0) {uSlip}
        
                                            Try
                                                Dim uResults As ReadResult() = stub.read(New ReadRequest(0) {uRead})
                                                If uResults.Length = 1 Then
                                                    For Each uResult As ReadResult In uResults
                                                        If uResult.errors IsNot Nothing Then
                                                            For Each err As oaError In uResult.errors
                                                                MessageBox.Show("Error " + err.code + ": " + err.comment + "" & Chr(9) & "" + err.text)
                                                            Next
                                                        End If
                                                        If uResult.objects IsNot Nothing Then
                                                            For Each slipfromDB As oaSlip In uResult.objects
                                                                update_localupdateddate(slipfromDB.id.ToString(), slipfromDB.updated, slipfromDB.slip_stageid, slipfromDB.type, slipfromDB.rate, slipfromDB.hour, slipfromDB.minute, slipfromDB.customerid, slipfromDB.projectid, slipfromDB.invoiceid, slipfromDB.projecttaskid, slipfromDB.total, slipfromDB.cost)
                                                            Next
                                                        End If
                                                    Next
                                                End If
                                            Catch ex As Exception
                                                MessageBox.Show(ex.Message)
                                            End Try
        
                                        End If
                                        'MessageBox.Show(upd_date, stage_date)
                                        'Me.lstRecords.Items.Add("Row id = " & row("id") & " | " & objSlip.updated.ToString() & " | " & row("updated"))
        
                                    End If
                                    row = Nothing
        
                                    'MsgBox("returned : " & envfromdb.id & " " & envfromdb.name)
                                    'Me.lstRecords.Items.Add(DatePart("YYYY", ySlip.updated) & " <> " & ySlip.id & "  <>  " & ySlip.updated & "  <>  " & ySlip.created & "  <>  " & ySlip.date)
                                    'MsgBox(DatePart("YYYY", ySlip.updated()))
                                    i += 1
                                Next objSlip
                            End If
                        Next result
                        Return i
                        'MessageBox.Show("Total " & i & " Slip(s) have been updated.")
                    Else
                        'MessageBox.Show("No new record found. Therefore, Sync was not performed")
                    End If
                Catch ex As Exception
                    MessageBox.Show("An exception occured, Please re-try" & ex.Message.ToString & ex.InnerException.ToString, "Please Re-try.", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning)
                End Try
            End Function
        Last edited by Banfa; Aug 21 '08, 01:47 PM. Reason: Correcting the code tags

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          If you don't care about the rules on the site, why should we care about helping you?

          This is a webpage application yes? Is it your SQL that is saying it has timed-out, or the webpage? There are settings in IIS (and web.config) for controlling how long to wait for a page to load.
          I believe it sets the Connection-Timeout header.

          Comment

          • dorandoran
            New Member
            • Feb 2007
            • 145

            #6
            1. Actually, I do care about the rules but caps in my first thread was not really all that of big issue. Plus I am always curteous and I beg for help. I was not demanding for help.

            2. I am using VS 2005 for windows forms (vb.net)

            3. Using web services (soap)

            4. Already send an e-mail to server team to find out server timeout property and increase the limit

            5. timeout is not on the sql end.

            Thanks
            Julie.

            Comment

            • Curtis Rutland
              Recognized Expert Specialist
              • Apr 2008
              • 3264

              #7
              Originally posted by dorandoran
              1. Actually, I do care about the rules but caps in my first thread was not really all that of big issue.
              Frustration or not, the rules are there for a reason. If you came to me in real life and shouted in my face asking for help, I wouldn't care if it was just because you were frustrated.

              Originally posted by dorandoran
              1. That reply did not help. I really dont have time and patience for a long lecture. I know the rules. My caps arent used for yelling, it was meant to display my own frustration with time-out issue.

              2. Please only reply to post related and NOT any advice that I really dont care cause I am under a thunder of frustration.

              Thanks
              Julie
              You're not in a position to tell us what the issues are. The rules for this site are clearly laid out in the posting guidelines that I've linked for you. I think that it's quite arrogant of you to tell the staff of this forum what rules we are allowed to enforce in regards to your posts.

              The experts here are unpaid, and you are coming to them to ask for help. If you don't wish to get lectures that you "really dont care [about]" then follow the rules. If you don't want to follow the rules, you can find help elsewhere.

              MODERATOR

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32634

                #8
                Originally posted by dorandoran
                1. That reply did not help. I really dont have time and patience for a long lecture. I know the rules. My caps arent used for yelling, it was meant to display my own frustration with time-out issue.

                2. Please only reply to post related and NOT any advice that I really dont care cause I am under a thunder of frustration.

                Thanks
                Julie
                Dorandoran,

                Let me make something clear here. Your responses were neither courteous, nor in accordance with site rules, and are entirely unacceptable. This level of discourtesy will always result in (at least) an official site warning.

                As you have already received two of these (the second normally results in a ban) you should be under no illusion as to what will follow if you proceed to break any further rules. Your account will be suspended for at least a week, the period depending on the severity of the infraction.

                This site is designed for the use of adult members and as such, your frustration is no excuse for this sort of behaviour. That would even be a stretch for a child to be frank.

                The Help section (Guideline to Moderators) makes it clear what you should do if you feel that you have been harshly or unjustly treated by a moderator.

                Administrator.

                Comment

                • dorandoran
                  New Member
                  • Feb 2007
                  • 145

                  #9
                  go ahead and ban my account. I read my post again and again and I did not find it to be offensive. I was very courteous and said please please please many time. I hardly receive any ideal response.

                  Comment

                  Working...