Re: pgoledb transaction error

Поиск
Список
Период
Сортировка
От gato pardo
Тема Re: pgoledb transaction error
Дата
Msg-id 1325341255690-5112200.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: pgoledb transaction error  ("David Johnston" <polobo@yahoo.com>)
Список pgsql-general
Thanks David

  Complying with your requirements:

"Tip 1: Provide the SQL statements you are trying to execute when you get
the
error; given that is it a "commit"-type error the entire transaction is
useful."

  I copy some of the code used:

MyConnectionString = "Provider=PostgreSQL OLE DB Provider;Data
Source=172.21.0.85;user id=postgres;password=;location=db_13N_QJM;"
MyO_DbConnection = New System.Data.OleDb.OleDbConnection(MyConnectionString)
MyO_DbConnection.Open()
MyO_DbCommand = New System.Data.OleDb.OleDbCommand
MyO_DbCommand.Connection = MyO_DbConnection

MySQL    = " UPDATE reg1001b set  tipo_1001b = 'P', descr_1001b = 'PASIVO',
statu_1001b = 'A', modifi_por_1001b = 'ADMINISTRATO', fecha_mod_1001b =
'12/31/2011 09:16:20' WHERE compania_1001b = 'QJM' and  tipo_1001b = 'P'"
String
       Try
            MyO_DbCommand.CommandText = MySQL
            MyO_DbTrans = MyO_DbConnection.BeginTransaction
            MyO_DbCommand.Transaction = MyO_DbTrans
            MyRes_01 = MyO_DbCommand.ExecuteNonQuery()
            MyO_DbTrans.Commit()

        Catch e As Exception
            MyO_DbTrans.Rollback()
            MyMsg = "Error # " & Str(Err.Number) & " Esta Generado Por : " _
                        & Err.Source & ControlChars.CrLf & ControlChars.CrLf
& Err.Description
            MsgBox(MyMsg, MsgBoxStyle.Information, "Error")
        End Try


"Tip 2: Make use of the PostgreSQL server logs to see exactly what the
server
is (has been) attempting to execute instead of the single error message the
client is seeing."

LOG:  could not receive data from client: Connection reset by peer
LOG:  unexpected EOF on client connection
LOG:  could not receive data from client: Connection reset by peer
LOG:  unexpected EOF on client connection
LOG:  could not receive data from client: Connection reset by peer
LOG:  unexpected EOF on client connection

 As the log shows we tried thrice to execute the above code.
  I should add that the same code, and much more, is  executed whout failure
when using odbc connection.

  Any advice ?

Felipe



--
View this message in context: http://postgresql.1045698.n5.nabble.com/commit-transaction-failed-tp1883952p5112200.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

В списке pgsql-general по дате отправления:

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Verifying a timestamp is null or in the past
Следующее
От: Ben Chobot
Дата:
Сообщение: Streaming replication failover