Now we simply need to add a call to the echo() method on the remote interface, and
our client will be complete.
Executing the client
We can execute our client by simply right-clicking on the Enterprise Application
project and clicking on Run . After a few seconds, we should see an information
dialog displaying the output of the session bean's method.
Clients deployed this way take advantage of Java Web Start technology. Java
Web Start applications run on the client workstation. However, they can be
executed from a URL. The Web Start URL for NetBeans enterprise application
client modules defaults to the Enterprise project name, followed by the application
client module name. In our example, the URL will be http://localhost:8080/
pointing the browser to this URL. The application client will be executed after
a brief wait.
At the time of writing, the this procedure does not work with
Session bean transaction management
As previously mentioned, one of the advantages of EJBs is that they automatically
take care of transactions. However, there is still some configuration that we need
to do in order to better control transaction management.
Transactions allow us to execute all the steps in a method or, if one of the steps fails
(for instance, an exception is thrown), roll back the changes made in that method.