aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Transaction timeout in EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Transaction timeout in EJB" Watch "Transaction timeout in EJB" New topic
Author

Transaction timeout in EJB

V Singh
Greenhorn

Joined: Sep 03, 2007
Posts: 6
Hi,

We are facing timeout issue in one of the method when running EJB on WAS5.1

The issue is that there are two batch jobs which get executed through this bean.1st batch job method has trans attribute of "<trans-attribute>NotSupported</trans-attribute>" in ejb-jar.xml while the 2nd batch job is not mentioned in the ejb-jar.xml with any trans-attribute.

Both these batch jobs are executed through Servlet/

The transaction timeout value set on the server is 30 minutes.The 1st batch job which has a trans-attribute of "NotSupported".It runs for more than 2 hours with out any issue.But the 2nd batch job when it runs beyond 30 mins,we see the following exception:-

aused by
{
Exception Message : javax.transaction.TransactionRolledbackException:
}
Stack Trace :
{
org.omg.CORBA.TRANSACTION_ROLLEDBACK: javax.transaction.TransactionRolledbackException: vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))
at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))
at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:341)
at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:805)
at javax.rmi.CORBA.Util.copyObject(Util.java:333)
at com.user.lan.wordengine.inf.service._InternalDocumentChart_Stub.performSuccess(_InternalDocumentChart_Stub.java:413)

I am absolutely clueless why 1st batch job is able to run successfully while the 2nd batch job is throwing exception after 30 minutes.

Why does the timeout affect only 2nd batch job and not 1st.

regards,
Vandana
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10033
    
163

V Singh,

Welcome to JavaRanch

By default, if you dont specify a transaction attribute, WebSphere sets it to transaction attribute = "Required" (if i remember right).


[My Blog] [JavaRanch Journal]
V Singh
Greenhorn

Joined: Sep 03, 2007
Posts: 6
Thanks for the quick response.Since the trans-attribute in case of 2nd batch job is Notsupported and so it runs in an unspecified transaction context so does that mean that transaction timeout doesn't impact in this while in the case of 1st job,since no trans-attribute is mentioned in deployment descriptor so as you mentioned that default is required so it begins the new transaction and transaction timout comes into picture.

Does this sound correct?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10033
    
163

Originally posted by V Singh:
Thanks for the quick response.Since the trans-attribute in case of 2nd batch job is Notsupported and so it runs in an unspecified transaction context so does that mean that transaction timeout doesn't impact in this while in the case of 1st job,since no trans-attribute is mentioned in deployment descriptor so as you mentioned that default is required so it begins the new transaction and transaction timout comes into picture.

Does this sound correct?


You have got it right(almost)

Going by your first post,

1st batch job method has trans attribute of "<trans-attribute>NotSupported</trans-attribute>" in ejb-jar.xml while the 2nd batch job is not mentioned in the ejb-jar.xml with any trans-attribute.

the reason why you are seeing this behaviour is

in case of 1st batch job is Notsupported and so it runs in an unspecified transaction context so does that mean that transaction timeout doesn't impact in this while in the case of 2nd job,since no trans-attribute is mentioned in deployment descriptor so as you mentioned that default is required so it begins the new transaction and transaction timout comes into picture.
V Singh
Greenhorn

Joined: Sep 03, 2007
Posts: 6
Hi,

Is there any documentation available which says that default trans-attribute for a method in EJB on WSAD is "required" ?

In case if the trans-attribute for a method is "NotSupported" that means that there is no transaction associated with the method and the transaction timeout value set on the server is of no use to that method? i.e the method would not time as per the transaction timeoput value given on the server.

I am really sorry if I am sounding stupid,but I am new to EJBs and wanted to have this funda of trans-attribute cleared.

Thanks,
Vandana
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10033
    
163

Originally posted by V Singh:
Is there any documentation available which says that default trans-attribute for a method in EJB on WSAD is "required" ?

In case if the trans-attribute for a method is "NotSupported" that means that there is no transaction associated with the method and the transaction timeout value set on the server is of no use to that method? i.e the method would not time as per the transaction timeoput value given on the server.

I am really sorry if I am sounding stupid,but I am new to EJBs and wanted to have this funda of trans-attribute cleared.

Thanks,
Vandana[/QB]


Sorry, i dont have a link to the document which mentions this. However, you could find the same on the IBM WebSphere Application Server documentation site.

Originally posted by V Singh:

In case if the trans-attribute for a method is "NotSupported" that means that there is no transaction associated with the method and the transaction timeout value set on the server is of no use to that method? i.e the method would not time as per the transaction timeoput value given on the server.



Absolutely right
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transaction timeout in EJB