This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes About non-transactional client in EJB in Action (2nd edition) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "About non-transactional client in EJB in Action (2nd edition)" Watch "About non-transactional client in EJB in Action (2nd edition)" New topic
Author

About non-transactional client in EJB in Action (2nd edition)

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 721
On p.174,

REQUIRE is the default and most commonly applicable transaction attribute value. This value specifies that the EJB method must always be invoked within a transaction. If the method is invoked from a non-transactional client, the container will start a transaction before the method is called and finish it when the method complete.


What is meant by non-transactional client?

I think if a client invoke a method annotated by @TransactionAttribute(TransactionAttributeType.REQUIRE), the client is making a new transaction or joining a transaction.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9913
    
158

Himai Minh wrote:

What is meant by non-transactional client?



In this context, it refers to a client which isn't already running in a transaction when invoking the EJB method.

[My Blog] [JavaRanch Journal]
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 721
Thanks. So, will the container determine if the client is transactional or non transactional?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9913
    
158

Himai Minh wrote:So, will the container determine if the client is transactional or non transactional?


It checks whether the incoming call has a transaction associated with it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: About non-transactional client in EJB in Action (2nd edition)
 
Similar Threads
java class calls multiple EJBs! will the EJBs share the Txn
non-trans method question;
Exception when Transaction attribute is never
Transaction boundries in CMT
Servlet endpoint Vs EJB endpoint