Usually you would access the injector bound to the thread. I think the API is CayenneRuntime.bindThreadInjector. On Fri, Nov 16, 2018 at 6:34 AM Hugi Thordarson <[email protected]> wrote:
> Hi all. > I have a library containing some utility code. Most of the utility methods > only accept an ObjectContext as an argument and don't know anything else > about the environment they're running in. However, some of that code needs > to run in transactions and for that I need TransactionFactories, normally > obtained from the ServerRuntime's injector: > > someServerRuntime.getInjector().getInstance( TransactionFactory.class ) > > So, I guess the question boils down to: Is there some way for me to obtain > a TransactionFactory (or an Injector) from an ObjectContext, without having > a ServerRuntime? > > Cheers, > - hugi
