Saturday, June 24, 2006

Running DbUnit on a Single Connection

When I run my DbUnit tests using on a single connection, I get the following exception:
java.sql.SQLException: No operations allowed after connection closed
My guess is DbUnit closes a connection after each test is run. This not an issue if I'm using an ordinary DB which allows multiple connections, but if I'm using Derby in embedded mode, I'm stuck, because embedded Derby only allows one connection at a time.

Is there a way to configure DbUnit to reuse a single connection?

Note: I'm using the default setup and teardown operations of DbUnit (CLEAN_INSERT).

UPDATE: Looks like I found the answer to my question.

No comments:

Post a Comment