In the explaination,
"Also remember that if the asynchronous method has return type void, any exception thrown by the bean method code never reaches the caller. The client may still get EJBException because of other issues such a bean or server not available."
I would say even if the asynchronous method has return type Futere<T>, and throws any application exceptions, the client still would not get these exceptions until called Future.get().
Am I correct?
Thanks.
About Question enthuware.oce-ejbd.v6.2.408 :
Moderator: admin
-
- Posts: 9
- Joined: Mon Oct 08, 2012 10:09 am
- Contact:
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.408 :
Yes, the difference is that in case of void return type, there is no possibility of doing Future.get() either and for this reason asynchronous methods with void return type are not allowed to throw any application exceptions.Jofen wrote:In the explaination,
"Also remember that if the asynchronous method has return type void, any exception thrown by the bean method code never reaches the caller. The client may still get EJBException because of other issues such a bean or server not available."
I would say even if the asynchronous method has return type Futere<T>, and throws any application exceptions, the client still would not get these exceptions until called Future.get().
Am I correct?
Thanks.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 7
- Joined: Sat Feb 08, 2014 8:30 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.408 :
Can you please help with some reference documentation to understand this behavior better?
Thanks,
vinay
Thanks,
vinay
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.408 :
You may check out Section 4.5.2 - Method Requirements
The client return type of an asynchronous method is either void or java.util.concurrent.Future<V>, where V is the result value type.
An asynchronous method with return type void must not declare any application exceptions.An asynchronous method with return type Future<V> is permitted to declare application exceptions.
If you like our products and services, please help us by posting your review here.
-
- Posts: 5
- Joined: Wed Jul 18, 2012 9:02 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.408 :
Hi,
About this question, if the client is accessing a remote session bean, shouldn't it get a RemoteException?
I know that void asynchronous methods cannot throw checked exceptions like RemoteException, so it could only throw System exceptions.
But will the system exception be converted in a remote exception by the container, being rethrown to the client?
About this question, if the client is accessing a remote session bean, shouldn't it get a RemoteException?
I know that void asynchronous methods cannot throw checked exceptions like RemoteException, so it could only throw System exceptions.
But will the system exception be converted in a remote exception by the container, being rethrown to the client?
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.408 :
No, there is no way for the client to get the exception because for the client, the method call returns immediately. If the method implementation throws an exception, the client will not be aware of it.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 66 guests