1

I'm working on a system which uses versant object database.

We have functional tests which sends requests to the server, server performs requested operation on database and returns results. Afterwards we send an opposite request which is supposed to restore db to previous state untill next test starts.

This is invalid approach, we try to restore db to previous state using the very same request we are testing.

Is there a feature similar to Oracle Flashback in Versant, if not what is the proper way to handle this problem?

Buyuk
  • 1,094
  • 1
  • 8
  • 23
  • How about a separate environment for testing? Running tests on production seems utterly wrong to me. – Sebastian Hoffmann Jul 05 '16 at 09:08
  • @SebastianHoffmann didnt say we run tests in production. Its a test environment. We need to restore db between two subsequent test cases. – Buyuk Jul 05 '16 at 09:13
  • In that case why not create a fresh schema for each test case? Is there anything preventing you from doing so? Have you tested this approach already, did you meassure an performance drop? If yes, is it bearable? Path of least resistance – Sebastian Hoffmann Jul 05 '16 at 09:19
  • Unfortunately, due to legacy test code we would have to load a lot of data each time in that case. We have tried this approach, but performance drop was not acceptable. We are slowly refactoring to prepare for this approach, but we are not there yet. – Buyuk Jul 05 '16 at 09:29
  • Im not familiar with versant but according to wikipedia it comes with transaction support (https://en.wikipedia.org/wiki/Versant_Object_Database#Transactions). In that case it should be sufficient to wrap the whoel test case in a transaction and roll it back at the end of it. – Sebastian Hoffmann Jul 05 '16 at 09:32
  • If you run it in a virtualization environment, like VMware, you can take a snapshot of the database server before the test then just revert to the snapshot afterwards. – xiaofeng.li Jul 05 '16 at 10:42
  • @LukeLee Unfortunately, no virtualization – Buyuk Jul 05 '16 at 12:18
  • @SebastianHoffmann True, there are transactions, I'm investigating if they can be used for this purpose. Their usability depends on if versant supports nested transactions and if the answer is yes than in what order are they processed. – Buyuk Jul 05 '16 at 12:21

0 Answers0