DataLoader in programmatically added fragment

Im using jmix 2.3.4
So i have a logic which is having fragment container in MainView and swap fragments with triggers like

...
Fragment newFragment = fragments.create(this, routes.get(route));
fragmentContainer.remove(activeFragment);
fragmentContainer.add(newFragment);
...

after this i want to load data with dataLoader in fragment itself with routePointDl.load(), i tried to put it in callbacks like onAttachEvent, onReadyEvent, onHostBeforeShow and get something only from onReady and onAttach but then another problem encounters, dataLoader is null for some reason. Also i have dataLoaderCoordinator auto="true" in main-view-.xml. So the question is, how to mange dataContainers in programmatically added fragments?

Update: just understood what not only dl is null, but whole dc

well, i found a problem, that was @Transactional in view controller and i don’t completely understand why, how an annotation about db causes whole controller to break?

Hello!

The @Transactional annotation cannot be used within Views or Fragments. Jmix manages their dependencies for injection and methods for subscription or installation. When @Transactional is used, Spring creates a proxy object, which may break Jmix dependency injection.