Hello, there~ I’m Kotlin Newbie who is trying the...
# getting-started
c
Hello, there~ I’m Kotlin Newbie who is trying the spring with Kotlin. I use Exposed to test the data generation, and I will test it by generating a table for testing, so I want you to drop the table automatically after the test. I thought @Transactional annoation would do this for me, but maybe it’s because I created a table when the Spring application came up, so the table generation doesn’t roll back after the test. How can I drop the table automatically??? I’d really appreciate your answer!
d
You didn't mention your specific DB setup but note that most SQL databases don't support rollback on DML (i.e. create or delete table) statements. One notable DB that supports this is PostgreSQL, though.
c
I used H2 db for test. If its a DB problem, there’s no other way but to create and leave a test table.