micho
micho

Reputation: 119

Why my dataset is not committed to my Oracle database using DBUnit and @DatabaseSetup annotation

I'm new to spring and DbUnit. I configured my DBUnitDatabaseConnection correct. I'm using the @DatabaseSetup(..) to insert a dataset. when requesting these data over my auto wired DAO-object, i am finding all my data. All is fine, but when i want to access the data over a REST request, i can't find any data, because they are not committed and saved to my oracle database. My data are committed after my test finished. How can i achieve that my data getting committed before my test method starts? Clearing and flushing my session doesn't work either.

UPDATE: These annotations are used in my testclass:

my dbConnection Bean has set "defaultAutoCommit" to "true", and "dataTypeFactory" to "Oracle10DataTypeFactory". My java-based configuration also enables TransactionManagement.

Upvotes: 0

Views: 690

Answers (1)

micho
micho

Reputation: 119

Instead of clearing and flushing the session, i committed the current transaction. That's working.

Upvotes: 0

Related Questions