From: <ch...@co...> - 2004-04-27 23:24:30
|
Yep. I'm taking about FbCommand.CommandTimeout. Since it is not supported by the Fb provider, I presume that the FbCommand can never timeout and therefore won't upset any positive code path and thus would never engage a negitive code path if it didn't throw an exception. Because FbCommand.CommandTimeout throws an exception it seems to be to defeat the polymorphic behavior defined by IDbCommand.CommandTimeout as it will not behave consistently across all providers. If the exception remains how then can you handle this polymorphically? Is it really an "exception" because the provider doesn't handle timeouts? In my view essentially CommandTimeout is a stub and Debug.Assert or Trace.Assert can be used to alert the developer. Chris > Hello: > > >In the database project that I've previously mention I had to write a > persistance layer that wraps the Firebird.NET provider. The reason is that I > can write to my persistance layer for both Firebird and possibly SQLServer and > other DB's. A situation could arise whereby data could be obtained from > disparate databases. > > > >The problem is that SQLServer provider supports ConnectionTimeout and the > Firebird provider throws an exception. My request is that ConnectionTimeout > rather than throw a runtime exeception to return 0 and use an Assert instead. > > > >Once again I modified the provider to return 0 causing no behavioral changes to > the provider but now my layer can work polymorphically. > > > Do you mean FbCommand.CommandTimeout ?? I'm not going to change that, > at least for now, in my opinion that will give the false impression that > it's supported and that it works, and it fact if you are going to use > the CommandTimeout property probably you will be trying to call Cancel > that will raise an NotSupported exception as well. > > I think the best for you will be to handle the NotSupported exception > (other providers may throw it too) > > > Opinions ?? > > > > -- > Best regards > > Carlos Guzmán Álvarez > Vigo-Spain |
From: <ch...@co...> - 2004-04-29 19:38:26
|
I agree with Mike and he express it much better than I did. While I appreciate the technology of the provider -- *compatiblity* -- it most important factor for Firebird adoption. In fact both Mono and DotGnu has both made compatibility with Microsoft.NET behavior its most paramount feature -- and for a good reason -- migration to Linux. I worked as a member of the Microsoft.NET/CLR team (Interop) and I can tell you Microsoft is formatible with their marketing strategy. If you want Firebird to be adopted you should do everything in your power to be behaviorially compatible with the SqlServer provider such that adoption and migration is as seemless as possible. This is why I think you should also adopt my Guid request as many shop will be reluctant to use Firebird just on this *resolvable* the issue of compatibility. However you do *not* need to throw an exception for ConnectionTimeout and Cancel because they do nothing to affect the mainline codepath. They are stubs. You can do an Assert (in the debug build) to notify the developer. The connection string idea is flawed because you can create a DbConnection without the connection string and call ConnectionTimeout before settting the connection string... FbConnection conn = new FbConnection(); conn.ConnectionTimeout = 100; // Bad: throw or not to throw? Remember the Firebird .NET provider is not a closed source binary delivery it is an open source delivery with excellent documenation. The fact that they are stub merely be placed in the documentation. Thanks, ChrisWa. > >> I think the best for you will be to handle the NotSupported exception > (other providers may throw it too) << > > This is the important point: what do other providers do? If none of them > throw an exception, then the Firebird provider shouldn't. If some do and > some don't, then it's a matter of opinion, but if the most common ones, > e.g. SQL Server, don't then probably FB shouldn't either. > > I agree with Carlos that it *should* throw an exception, but no provider > is an island so to speak, and we must think about compatibility with > other providers. > > Can't you add an option in the connection string to switch off > exceptions in this one case? That way, anyone wanting to switch > providers just has to add one line to the connection string, and it'll > work like some other providers. > > Cheers, > > Mike. > |
From:
<car...@te...> - 2004-04-29 20:42:51
|
Hello: >I agree with Mike and he express it much better than I did. While I appreciate the technology of the provider -- *compatiblity* -- it most important factor for Firebird adoption. In fact both Mono and DotGnu has both made compatibility with Microsoft.NET behavior its most paramount feature -- and for a good reason -- migration to Linux. > >I worked as a member of the Microsoft.NET/CLR team (Interop) and I can tell you Microsoft is formatible with their marketing strategy. If you want Firebird to be adopted you should do everything in your power to be behaviorially compatible with the SqlServer provider such that adoption and migration is as seemless as possible. > I know that ;) and that is the reason the provider has named parameters with the same sintax as SqlServer, stored procedure execution using only the sp name as in SqlServer, implicit transaction support and batch querys (that for now are only in ExecuteReader) >This is why I think you should also adopt my Guid request as many shop will be reluctant to use Firebird just on this *resolvable* the issue of compatibility. > I'm thinking on it, but was is needed for this is not only to modify the GdsReader/GdsWriter implementation (XdrStream in 1.6), it's needed to define a new type in FbDbType enum (and DbDatatype), implement the FbDataReader.GetGuid() ... >However you do *not* need to throw an exception for ConnectionTimeout and Cancel because they do nothing to affect the mainline codepath. They are stubs. You can do an Assert (in the debug build) to notify the developer. > The assemblys are released without the DEBUG define and with use the /debug switch for emit the debug information. In my opinion ( maybe i'm worng ) the exception is needed as soon as it's not supported, the other option is to make the same as MS does in the OracleClient provider with the CommandTimeout property. I don't have problem on remove the exception, but without it people is going to ask why it's not working, i'm sure about this and i want to avoid it ;) >Remember the Firebird .NET provider is not a closed source binary delivery it is an open source delivery with excellent documenation. The fact that they are stub merely be placed in the documentation. > I know ;) and all suggestions and ideas for the .NET provider development are more than wellcome -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From:
<car...@te...> - 2004-04-29 21:20:58
|
Hello: > The assemblys are released without the DEBUG define and with use the > /debug switch > for emit the debug information. Sorry i mean without the /debug switch -- Best regards Carlos Guzmán Álvarez Vigo-Spain |