Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

ejbCreate -permitted and prohibited operations -

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
... about permitted and prohibited operations in an ejbCreate
method for a stateful session bean and a stateless session bean.




1) Why I can't mark the current transaction to roll back ?
2) Why I can't Determine whether the transaction has already been marked for rollback?
3) Why I can get a reference to the transaction? (no for stateless)

Thanks
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Why I can't mark the current transaction to roll back ?


ejbCreate never runs in the context of a transaction, so there is nothing to mark for rollback.

Why I can't Determine whether the transaction has already been marked for rollback?


Same reason as above.

Why I can get a reference to the transaction? (no for stateless)


A BMT stateful session bean demarcates its transaction boundaries, and is allowed to do this from ejbCreate. For CMT beans, demarcation is started from the business methods.
 
marcus don
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roger, may you please explain me the meaning of

A BMT stateful session bean demarcates its transaction boundaries

even with an example Thanks!
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following is not tested code (I've written it here in as hurry), but it does give an indication of how you can do this.
 
marcus don
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you !
 
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic