wisdom-framework / wisdom-orientdb

Wisdom OrientDB integration
Apache License 2.0
2 stars 3 forks source link

Allow to disable LazyLoading #7

Closed nicolas-rempulski closed 10 years ago

nicolas-rempulski commented 10 years ago

A property in application.conf should allow to disable LazyLoading in the instantiated CRUD.

I think, in OrientDbCrudService, something like

@Requires
private ApplicationConfiguration appConf;

[...]
private void acquire() {
        if (db == null || db.isClosed()) {
            db = pool.acquire();
            db.setLazyLoading(appConf.getBooleanOrDefault("orientdb.lazyloading", false);
        }
    }

Would do the trick

barjo commented 10 years ago

We could add a special property from the application.conf, for example:

ortientdb.mydb.autolazyloading = true

The default value would be true, since by default on orientdb the lazyloading is activated. Does that sound all-right for you ?

nicolas-rempulski commented 10 years ago

Yep seems perfect.

A bonus would be to use a model annotation / application conf key to list models we want to use LazyLoading with and those not to use LazyLoading. But seems more difficult and not necessarily useful.

barjo commented 10 years ago

:+1: All right, we will keep it simple for now.

barjo commented 10 years ago

close with f56f2fc6eaddc2164f7237f6d1d44da55215ecef