in0where / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

Dapper looses connection string with iAnywhere v 38404 and higher #133

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Install Sybase on your pc, create sample project
2. Type some code that does request to the db
3. Exception:
 System.NullReferenceException - Object reference not set to an instance of the object

What is the expected output? What do you see instead?

I expect to get some data from db with my request, but get ab error - 
Object reference not set to an instance of the object.

What version of the product are you using? On what operating system?
Dapper 1.12.1, OS - Windows 7

Please provide any additional information below.
Exception message:

[NullReferenceException: Object reference not set to an instance of the object.]
   iAnywhere.Data.SQLAnywhere.SAConnection.CalledByEntityFramework() +263
   iAnywhere.Data.SQLAnywhere.SAConnection.get_ConnectionString() +538
   Dapper.Identity..ctor(String sql, Nullable`1 commandType, IDbConnection connection, Type type, Type parametersType, Type[] otherTypes) +73
   Dapper.<QueryInternal>d__13`1.MoveNext() +545
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   Dapper.SqlMapper.Query(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) +218
   Dapper.SqlMapper.Query(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) +88

Everything works fine until sybase create fix v 12.3457 and in 16 version 
nothing chcanges - the same error! I look into connection object in debug.
In _connStr property cinnection string is right, but in +       ConnectionString I 
see exception message - 'cn.ConnectionString' threw an exception of type 
'System.NullReferenceException' string {System.NullReferenceException}

Original issue reported on code.google.com by Artem.Ya...@gmail.com on 16 Mar 2013 at 8:06

GoogleCodeExporter commented 8 years ago
Principally, this sounds like a bug in that specific ADO.NET implementation. 
The error is coming from inside a 3rd party component. The best I can suggest 
is: report it to *them*.

We use the connection-string to provide back-end specific structural caching; 
we know that many sites have similar (but not always the same) structures on 
multiple databases. The only other thing we can do is to look more at the 
structure itself - I'll check if we hash that currently.

Original comment by marc.gravell on 19 Mar 2013 at 8:04

GoogleCodeExporter commented 8 years ago
Thanks, I've already write to sybase support. It's theirs bug!
http://sqlanywhere-forum.sybase.com/questions/16003/bug-in-ianywheredatasqlanywh
erev40dll?page=1#16010

Original comment by Artem.Ya...@gmail.com on 19 Mar 2013 at 8:24