Enterprise Services and TDD part 2

I mentioned yesterday a special case of Roy's excellent article on using Enterprise Services with database unit testing where it seems to produce an inconsistent result with NUnit. The case involves a Server Application (I didn't try a Library Application for my test), Oracle, and NUnit. The issue is I can test successfully every other time, with a RollBack at the end of each transaction in order to put the database back to its original state. It's the every other time after that fails with these messages:

ORA-03113: end-of-file on communication channel

and

System.Runtime.InteropServices.COMException : You made a method call on a COM+ component that has a transaction that has already aborted or in the process of aborting.

Has anyone seen a solution to these problems? In our case, the way we solved this ultimately was to do the standard way of testing database layer code by either rebuilding the data schema over again (getting the data into a consistent state) or writing the tests in such a way as not needing to do a RollBack.  For unique constraint tests, I would use a GUID appended to a value.

As far as I can tell, Roy's usage of NUnit and Enterprise Services works perfectly with SQL Server, and I see it as a great solution. I think the issues I see with Oracle have to do with some missing or wrongly configured Oracle/MSDTC settings rather than flaws in Roy's approach. If anyone has a clue about the Oracle messages above, it would be greatly appreciated, as well as possibly helping someone else.

Update: If memory serves me correctly, I think we also determined at the time this oddity was related to an existing bug in v. 1.1 code with the System.Data.OracleClient namespace. A bug fix was available, but only if it was a major problem (not publically available). I can test in Whidbey code to determine if this issues is now resolved.

6 Comments

  • Hi,



    Are you using Oracle 8i? If so, it often has some problems with OracleClient driver. Check sqlnet log to see whether there is any wierd stuff in there.

  • I am using Oracle 9i (for Windows 2003: 9.2.0.4).

  • Are you connecting to local database? If not, what is the version on the client side?

  • Also, I found this problem before where I had a firewall sit between the app server and the database server. Sometimes, the firewall terminates the connection causing the aforementioned error.

  • Actually, in my test, the client is Windows XP with 9.2.0.1. The Oracle server is 9.2.0.4 running on Unix/Solaris. Again, its not a problem I am trying to solve today (this was "solved" by us many months ago by using different methods as mentioned above). It is only an issue if someone else is having the same problems in their own code.

  • Obviously well aware of these :)

    Unfortunately, I think this is something else. Thanks anyway.

Comments have been disabled for this content.