This is a migrated thread and some comments may be shown as answers.

Issue with Npgsql 2.0.13-beta1

2 Answers 233 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Caleb
Top achievements
Rank 1
Caleb asked on 22 Jan 2016, 08:39 PM

We are using Telerik.DataAccess.Core version 2015.3.1221.1 with PostgreSQL 9.x. To my knowledge,  Npgsql version 2.0.13-beta1 is the only one that will work at this time. The current stable version of Npgsql is version 3.0.5. Is there anything we can to do to use Telerik.DataAccess.Code with a more recent version of Npgsql?


Furthermore we are using OpenAccessContext.GetSchemaHandler() to generate an update script, but the library is reading the wrong information about the column type. It keeps complaining that the column is a bpchar(1), when it is already a character(1).

http://screencast.com/t/KWYCVpdReRI

 

 

We are also facing an issue as described by this call stack. Any ideas as to why this is failing?

 

Telerik.OpenAccess Error: 5 : Npgsql.NpgsqlException: ERROR: 08P01: bind message has 4 result formats but query has 1 columns
CommandType=Text, CommandTimeout=30, ConnectionState=Open, Transaction=-1
Telerik.OpenAccess Error: 4 : System.NotSupportedException: Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.
CommandType=Text, CommandTimeout=30, ConnectionState=Open, Transaction=-1
Telerik.OpenAccess Error: 6 : System.NotSupportedException: Backend sent unrecognized response type: m
CommandType=Text, CommandTimeout=30, ConnectionState=Open, Transaction=-1
Telerik.OpenAccess Error: 7 : Error executing query: Telerik.OpenAccess.RT.sql.SQLException: ERROR: 08P01: bind message has 4 result formats but query has 1 columns ---> Npgsql.NpgsqlException: ERROR: 08P01: bind message has 4 result formats but query has 1 columns
   at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext() in c:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:line 882
   at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1173
   at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1191
   at Npgsql.ForwardsOnlyDataReader.NextResult() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1377
   at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1040
   at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 642
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 588
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 538
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at OpenAccessRuntime.CommandWrapper.ExecuteReader(CommandBehavior behavior)
   at Telerik.OpenAccess.Runtime.Logging.LoggingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.CommandImp.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
SQL:
SELECT COUNT(1) AS  EXPR1                  FROM "templates" AS a WHERE a."company_id" = ?                                        Telerik.OpenAccess.RT.sql.SQLException: ERROR: 08P01: bind message has 4 result formats but query has 1 columns ---> Npgsql.NpgsqlException: ERROR: 08P01: bind message has 4 result formats but query has 1 columns
   at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext() in c:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:line 882
   at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1173
   at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1191
   at Npgsql.ForwardsOnlyDataReader.NextResult() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1377
   at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1040
   at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 642
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 588
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 538
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at OpenAccessRuntime.CommandWrapper.ExecuteReader(CommandBehavior behavior)
   at Telerik.OpenAccess.Runtime.Logging.LoggingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.CommandImp.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
Telerik.OpenAccess Error: 8 : Error executing query: System.NotSupportedException: Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream. ---> System.NotSupportedException: Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.
   at System.IO.BufferedStream.ClearReadBufferBeforeWrite()
   at System.IO.BufferedStream.WriteByte(Byte value)
   at Npgsql.NpgsqlSync.WriteToStream(Stream outputStream) in c:\projects\Npgsql2\src\Npgsql\NpgsqlSync.cs:line 45
   at Npgsql.NpgsqlReadyState.SyncEnum(NpgsqlConnector context) in c:\projects\Npgsql2\src\Npgsql\NpgsqlReadyState.cs:line 83
   at Npgsql.NpgsqlState.Sync(NpgsqlConnector context) in c:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:line 213
   at Npgsql.NpgsqlConnector.Sync() in c:\projects\Npgsql2\src\Npgsql\NpgsqlConnector.cs:line 328
   at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1163
   at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1191
   at Npgsql.ForwardsOnlyDataReader.NextResult() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1377
   at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1040
   at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 642
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 588
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 538
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at OpenAccessRuntime.CommandWrapper.ExecuteReader(CommandBehavior behavior)
   at Telerik.OpenAccess.Runtime.Logging.LoggingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.CommandImp.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
SQL:
SELECT a."category_id" AS COL1, a."company_id" AS COL2, a."company_id" AS COL3, a."name" AS COL4 FROM "categories" AS a WHERE (a."company_id" = ?                                       OR a."company_id" IS NULL) ORDER BY COL1  System.NotSupportedException: Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream. ---> System.NotSupportedException: Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.
   at System.IO.BufferedStream.ClearReadBufferBeforeWrite()
   at System.IO.BufferedStream.WriteByte(Byte value)
   at Npgsql.NpgsqlSync.WriteToStream(Stream outputStream) in c:\projects\Npgsql2\src\Npgsql\NpgsqlSync.cs:line 45
   at Npgsql.NpgsqlReadyState.SyncEnum(NpgsqlConnector context) in c:\projects\Npgsql2\src\Npgsql\NpgsqlReadyState.cs:line 83
   at Npgsql.NpgsqlState.Sync(NpgsqlConnector context) in c:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:line 213
   at Npgsql.NpgsqlConnector.Sync() in c:\projects\Npgsql2\src\Npgsql\NpgsqlConnector.cs:line 328
   at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1163
   at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1191
   at Npgsql.ForwardsOnlyDataReader.NextResult() in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1377
   at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) in c:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1040
   at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 642
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 588
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in c:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 538
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at OpenAccessRuntime.CommandWrapper.ExecuteReader(CommandBehavior behavior)
   at Telerik.OpenAccess.Runtime.Logging.LoggingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.CommandImp.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()

2 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 26 Jan 2016, 04:00 PM
We will update our supported npgsql driver soon and the next build should have this fixed.

I will inform you when it's ready.

Regards,
Thomas
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
0
Thomas
Telerik team
answered on 16 Feb 2016, 02:16 PM
Unfortunately, using 3.0.5 is currently not doable as it requires a .NET 4.5 stack.
However, you should be able to use the 2.2.7 version of Npgsql, but you need to be aware that 
we currently do not use this version yet in our automated tests; this is planned for the next future.

Regards,
Thomas
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
Databases and Data Types
Asked by
Caleb
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or