Here is the code that has stopped working:
Code: Select all
Sub execute_script()
Using script As New PgSqlDataTable("select id,script,fail_ok from version_script where version_id>(select max(version.id) from version) or version_id=0 order by version_id,id", conn)
script.Fill()
ProgressBarControl.EditValue = 0
Dim i As Int64 = 0
Using sql As New PgSqlCommand() With {.CommandTimeout = 0, .Connection = conn, .CommandText = "utils.execute_script", .CommandType = CommandType.StoredProcedure}
sql.Parameters.Add("in_script_id", PgSqlType.BigInt)
sql.Parameters.Add("in_script", PgSqlType.Text)
sql.Parameters.Add("in_fail_ok", PgSqlType.Boolean)
sql.Prepare()
For Each row As DataRow In script.Rows
sql.Parameters("in_script_id").Value = row("id")
sql.Parameters("in_script").Value = row("script")
sql.Parameters("in_fail_ok").Value = row("fail_ok")
Dim ar As IAsyncResult = sql.BeginExecuteReader()
i += 1
ProgressBarControl.EditValue = i / script.Rows.Count * 100
ExecutingMemoEdit.Text = ""
Application.DoEvents()
If Not ar.IsCompleted Then
ExecutingMemoEdit.Text = row("script")
End If
While Not ar.IsCompleted
Application.DoEvents()
End While
Dim reader As PgSqlDataReader = sql.EndExecuteReader(ar)
While reader.Read
If Not reader.GetString(0) = "OK" Then
Log.Text &= row("id") & ": " & row("script") & vbCrLf
Log.Text &= reader.GetString(0) & vbCrLf
End If
End While
reader.Close()
Next
End Using
End Using
End Sub
Code: Select all
Devart.Data.PostgreSql.PgSqlException was unhandled
ErrorCode=08006
ErrorCode (ExternalException)=-2147467259
LineNumber=0
Message=Server did not respond within the specified timeout interval.
Position=0
Source=mscorlib
StackTrace:
Server stack trace:
at Devart.Data.PostgreSql.PgSqlDataReader.e(Int32 A_0)
at Devart.Data.PostgreSql.PgSqlCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Common.DbCommandBase.AsyncExecuteReader(CommandBehavior behavior)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at Devart.Common.DbCommandBase.a.EndInvoke(IAsyncResult A_0)
at Devart.Common.DbCommandBase.EndExecuteReader(IAsyncResult result)
at Devart.Data.PostgreSql.PgSqlCommand.EndExecuteReader(IAsyncResult result)
at Dolphin.dbUpgradeForm.execute_script() in C:\Users\Tobie\Documents\Visual Studio 2010\Projects\dolphin\trunk\Estimating\Utils\dbUpgradeForm.vb:line 60
at Dolphin.dbUpgradeForm.Upgrade() in C:\Users\Tobie\Documents\Visual Studio 2010\Projects\dolphin\trunk\Estimating\Utils\dbUpgradeForm.vb:line 121
at Dolphin.loginForm.OKButton_Click(Object sender, EventArgs e) in C:\Users\Tobie\Documents\Visual Studio 2010\Projects\dolphin\trunk\Estimating\loginForm.vb:line 114
at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at Dolphin.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TimeoutException
Message=Server did not respond within the specified timeout interval.
Source=Devart.Data.PostgreSql
StackTrace:
at Devart.Common.ac.a(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Common.d.c(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Common.n.e(Byte[] A_0, Int32 A_1, Int32 A_2)
InnerException: System.IO.IOException
Message=Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Source=System
StackTrace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at Devart.Common.ac.a(Byte[] A_0, Int32 A_1, Int32 A_2)
InnerException: System.Net.Sockets.SocketException
ErrorCode=10060
Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
NativeErrorCode=10060
Source=System
StackTrace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
InnerException: