Rollback a certain amount of transactions during deveopment?
Are there any tools around that monitor db transactions transparently and allow for batch rollback? Something similar to what DBunit offers but not in the context of a unit test but for a slightly longer period of time (say for a test that lasts 5-10 minutes, done in the UI and not in a automated test)
Like: a developer integrate开发者_如何学编程s a new feature and tests it interactively. 10 minutes, the data is messed up and he wants to go back to a safe state of the database.
Backups / snapshots are not suitable here as the database is pretty large and going back to a backup / snapshot is time consuming. So something that is more lightweight would be preferred.
Btw, Windows SQL Server 2008 Standard is used, so we cannot use snapshots at all. Technology stack for the application is Java / JPA / Hibernate.
Thanks!
I don't know of anything available to achieve what you describe. You have to manage your own transactions on your connection to the database.
You could start a transaction at the beginning of your tests and then roll it back at the end but that has the side effect of locking the tables preventing others from using the DB.
You might want to look at using a SQLite database, loaded with test data, which you use then "throw away". It's fast and great for testing.
精彩评论