Issue with Npgsql 2.0.13-beta1

3 posts, 0 answers
  1. Caleb
    Caleb avatar
    1 posts
    Member since:
    Jun 2014

    Posted 22 Jan Link to this post

    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. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 26 Jan Link to this post

    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.
  3. DevCraft banner
  4. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 16 Feb Link to this post

    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.
Back to Top