• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

in EJB3, is there still need Container-Managed Transaction (CMT) Demarcation

 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in EJB3, is there still need to write something like
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public CustomerOrder createCustomerOrderUsingSupports(Customer customer)
throws Exception { ... }

also, if I write
@PersistenceContext
private EntityManager em;

public void method1(){
em.persist(object1);
em.persist(object2);
};

if em.persist(object2) has exception, will object1 rollback? (assume method 1 has not write any @TransactionAttribute explicitly)
 
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not required.
It's available.
Chapter 16, Enterprise Javabeans 3.0 is a good resource.

yes, if method1() is on an session bean, the whole thing will roll back without explicit transaction demarcation
 
reply
    Bookmark Topic Watch Topic
  • New Topic