Skip site navigation (1) Skip section navigation (2)

Re: pgoledb transaction error

From: gato pardo <gato(dot)pardo(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pgoledb transaction error
Date: 2011-12-31 14:20:55
Message-ID: 1325341255690-5112200.post@n5.nabble.com (view raw or flat)
Thread:
Lists: 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.

In response to

pgsql-general by date

Next:From: Ben ChobotDate: 2011-12-31 21:02:38
Subject: Streaming replication failover
Previous:From: Raymond O'DonnellDate: 2011-12-31 09:26:58
Subject: Re: Verifying a timestamp is null or in the past

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group