From: Pavol S. <st...@st...> - 2003-03-28 01:04:59
|
hi, this is really interesting problem... Ideology of your provider and for example MS provider or Ado itself is little, but in main things different... and of course your provider is still not finished. Im affraid that you do it in way how ib or now fb API works and did not check how other common providers work... anyway i like your point of view and dont like to add there new features becouse each new feature is performance hit and makes code dirty... It like with firebird server. It have now lot of new features but its 20% slower :( i see that you want to make your provider as near to ADO.NET as possibe.. Its great idea. But i think, that you have to make there new layer of codebase for example ADOFbConnection and so... Becouse there is still lot of work in base layer... You can have to have one connection for one command (big problem), problems with cleaning resources when i forgot dispose something... And trying to force it to be ADO compatible will not work... So simple as i wrote there are constructor where you assign transactions, in this step when assigned transaction is null or not specified you create and start new one... and when you call close or dispose you will commit or rollback... In this case will be transaction closed by command not connection, and is not created for each statement, so you can call prepare many times... And oposite there is one transaction which will be closed as command is closed (transaction is private in this case) so there will not be problem with lot of transaction to be closed by connection... Best way i see is create inherited class ADOFbCommand with new overloaded constructor and new close and dispose. Or you can replace this: if (Transaction == null) throw new InvalidOperationException("Command must have a valid Transaction."); in executeNoQuery, Scalar, Reader by if (Transaction == null) Transaction = Connection.BeginTransaction(); // ofcourse you know that there is connection you can put this only in ExecuteReader an can set behavior to CloseConnection and there will be no problems with closing :) As i wrote this, why near all classes are sealed??? There is lot of possibilities how to do that. Question whis is best :) BUT PLEASE DO NOT MIX IT IN WORKING CODE, until all other required features are implemented... i fell that it will bring lot of problems to try it make MS compatible and will corrupt working code... AND I WANT TO THANK YOU FOR THIS PROVIDER ITS GREAT, ITS PERFECT, ITS BEST :) I use it every day and for now i did not find any problem which cannot be done by this or any bug you did not correct fast... p. |