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 |