• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Container-Managed Transaction

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Stateless
@TransactionManagement(CONTINER)
public class MySessionBean implements MySession
{
@TransactionAttribute(REQUIRED)
public void methodA()
{
. . . .
methodB(); // call to non business method
}



@TransactionAttribute(REQUIRED_NEW)
private void methodB()
{
}
}


//business interface
@Remote
public interface MySession
{
public void methodA();
}


As for core spec page no 330

Only these methods can specify transaction attribute
The enterprise bean�s business methods, message listener methods, business method interceptor methods,
lifecycle callback interceptor methods, or timeout callback method

Considering this we can not specify transaction attribute on methodB() which is not a business method. But I am not sure why ?

Please correct me if I am wrong. Is my understanding is wrong ?

Thanks
Pavan Kumar

[ May 21, 2008: Message edited by: Pavan Shahi ]

[ May 21, 2008: Message edited by: Pavan Shahi ]
[ May 21, 2008: Message edited by: Pavan Shahi ]
 
Ranch Hand
Posts: 121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Business methods are the methods defined in your business interface.
In this case, MySession interface, which defines only methodA().

By the way, use the CODE tags when posting source code.
[ May 30, 2008: Message edited by: Rodrigo Lopes ]
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Only these methods can specify transaction attribute
The enterprise bean�s business methods, message listener methods, business method interceptor methods,
lifecycle callback interceptor methods, or timeout callback method



I have doubt realted the above , how could transaction attributes be applied for lifecycle call interceptor methods. Life cycle method do not execute with under any security or transaction context.Can someone tell me how it makes sense to apply transaction attribute on lifecycle callback interceptor methodslifecycle callback interceptor methods. thanks !
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not clear about your question. But still I can conclude that, if your methods are not defined in the interface then,it doesn't mean that, they are not business methods. They are exposed business methods. The methods which are not defined in the interface can also be termed as business methods and hence cna be involved in the same transaction semantics as that of an exposed method.
[ June 02, 2008: Message edited by: nitin pai ]
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic