Thanks John and Andrus. I'll probably just indicate in the method documentation 
that they require the calling thread to have an Injector bound (throwing some 
helpful error if they don't).

Cheers,
- hugi


> On 19 Nov 2018, at 06:18, Andrus Adamchik <[email protected]> wrote:
> 
>> 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?
> 
> No, so this needs to be custom-designed.
> 
> Andrus
> 
> 
>> On Nov 16, 2018, at 3:34 PM, 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
> 

Reply via email to