ManagedServiceExecutor JPA

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ManagedServiceExecutor JPA

Matthew Broadhead-2
hi, i just tried to use a ManagedServiceExecutor for Asynchronous like

@Resource
private ManagedExecutorService managedExecutorService;
...
public void something(MyObject myObject) {
     managedExecutorService.submit(() -> somethingFork(myObject));
}

it seems to be fine with CDI injection but it blows up when trying to
get an entity manager
CriteriaBuilder cb = em.getCriteriaBuilder();

it goes to to (org.apache.openejb.threads.task) CUTask.throwable()
Reply | Threaded
Open this post in threaded view
|

Re: ManagedServiceExecutor JPA

jgallimore
Hi Matthew

Are you able to wire up an Arquillian test for us?

Thanks

Jon

On Wed, Jan 9, 2019 at 11:54 AM Matthew Broadhead
<[hidden email]> wrote:

> hi, i just tried to use a ManagedServiceExecutor for Asynchronous like
>
> @Resource
> private ManagedExecutorService managedExecutorService;
> ...
> public void something(MyObject myObject) {
>      managedExecutorService.submit(() -> somethingFork(myObject));
> }
>
> it seems to be fine with CDI injection but it blows up when trying to
> get an entity manager
> CriteriaBuilder cb = em.getCriteriaBuilder();
>
> it goes to to (org.apache.openejb.threads.task) CUTask.throwable()
>
Reply | Threaded
Open this post in threaded view
|

Re: ManagedServiceExecutor JPA

Matthew Broadhead-2
i would be happy to try.  could you point me to a similar test which i
could base it on?

On 09/01/2019 13:16, Jonathan Gallimore wrote:

> Hi Matthew
>
> Are you able to wire up an Arquillian test for us?
>
> Thanks
>
> Jon
>
> On Wed, Jan 9, 2019 at 11:54 AM Matthew Broadhead
> <[hidden email]> wrote:
>
>> hi, i just tried to use a ManagedServiceExecutor for Asynchronous like
>>
>> @Resource
>> private ManagedExecutorService managedExecutorService;
>> ...
>> public void something(MyObject myObject) {
>>       managedExecutorService.submit(() -> somethingFork(myObject));
>> }
>>
>> it seems to be fine with CDI injection but it blows up when trying to
>> get an entity manager
>> CriteriaBuilder cb = em.getCriteriaBuilder();
>>
>> it goes to to (org.apache.openejb.threads.task) CUTask.throwable()
>>