grails - How do I proxy a production database with a testing database? -
i'm working on grails project has static production database lot of data in it. test application using production data, instead of having clone production database i'd setup proxy database production database.
essentially reads of database go way production database while writes stop @ proxy database (preferably h2 database). if row updated came production database row saved proxy database , returned, instead of production's row, on subsequent queries.
i'd of transparently application possible. line of thinking i'd need fork hibernate gorm implementation , make support use case. has been done before? there better way?
forking hibernate gorm
implementation may not idea. stuck in version , have to, somehow, make date original plugin (eg. bug fix, new implementations).
maybe custom testmixin allows override all registered domain classes, new implementations of save()
, get()
, find()
, etc can option. can work metaclass override static methods , triggered on tests annotated mixin.
with can use multiple datasources in test environment determine used.
Comments
Post a Comment