• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Container-Managed Transaction

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic