It looks like there is a problem with the validation code in the setters of these two properties. If I set the connection and then the transaction, all is fine. But if I try to set the transaction first - it throws an InvalidOperationException with a message saying that the transaction's connection and the VerticaCommand's connection must be the same. It makes sense - the connection property is still null. It reveals a flaw in the base class DbCommand - allows dependency between the properties. The solution is simple - do it in the right order, however I do not have access to the calling code that does this. It works with SqlServer. My solution was to wrap the VerticaCommand class in MyVerticaCommand; allow for any transactions if the connection is null and store it in a temp. field; and when they set the connection - compare it with the Transaction's connection and if not the same - throw the exception, otherwise set both in the right order.
I am hoping that in spite of this being a small problem it can be fixed and I can get rid of the silly MyVerticaCommand class in my code.
Thanks
Val