Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction timeout in EJB

 
V Singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
V Singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic