public function register(Application $app)
    {
        $app['db'] = $app->share(function ($app) {
            return new Adapter($app['config']->load('db'));
        });

        $app['db.transaction'] = $app->share(function ($app) {
            return new Transaction($app['db']);
        });

        $app->initializer(
            'Synapse\\Db\\TransactionAwareInterface',
            function ($object, $app) {
                $object->setTransaction($app['db.transaction']);
                return $object;
            }
        );

        $this->registerMapperInitializer($app);
    }