WebSphere Application Server - Ejb Transaction timeout

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > February 2007 > Ejb Transaction timeout





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Ejb Transaction timeout

2007-02-15, 7:16 pm

Hello all,
I'm new to websphere. Is there a way i can set the Transaction timeout at the method level or at the ejb level?

We are using container managed transactions. We have a session bean which has few methods. I want to set the different time out on each method. Also, is there a way i can set different timeout on different sesion beans.

I really appreciate your help.

Thank you,
ana.

Andy Wilkinson

2007-02-16, 7:21 am

nywheresoft@yahoo.com wrote:
> Hello all,
> I'm new to websphere. Is there a way i can set the Transaction timeout at the method level or at the ejb level?
>
> We are using container managed transactions. We have a session bean which has few methods. I want to set the different time out on each method. Also, is there a way i can set different timeout on different sesion beans.
>
> I really appreciate your help.
>
> Thank you,
> ana.
>


Ana,

As of WAS 6.0 you can configure transaction timeout for EJBs using
container-managed transactions on a per-component basis. Refer to the
Global Transaction Timeout section of this page from the InfoCenter:

http://publib.boulder.ibm.com/infoc...jta_entra2.html

There is no way to configure the timeout for CMT beans on a per-method
basis.

If you're using bean-managed transactions you can use the
UserTransaction.setTransactionTimeout() method to configure the desired
timeout prior to beginning the transaction. This applies to all versions
of WAS.

Thanks,
Andy
Randy Schnier

2007-02-16, 1:18 pm

Andy's already answered your main question, but the following is also worth mentioning (since setting the transaction timeout value sometimes leads to this question):

Setting the transaction timeout to a particular value will *not* cause your EJB method to be interrupted after that amount of time. Your EJB method will proceed until completion (however long that takes) according to your code within the method itself.
The transaction timeout setting says: "If the transaction is not completed within this amount of time, mark it for rollback, so when the method completes and the container later tries to complete the transaction, it will roll back rather than commit." Th
is is not unique to WAS; it's due to the way JVM threads work.

Happy coding.

nywheresoft@yahoo.com wrote:
> Hello all,
> I'm new to websphere. Is there a way i can set the Transaction timeout at the method level or at the ejb level?
>
> We are using container managed transactions. We have a session bean which has few methods. I want to set the different time out on each method. Also, is there a way i can set different timeout on different sesion beans.
>
> I really appreciate your help.
>
> Thank you,
> ana.
>

Ben_

2007-02-16, 1:18 pm

Worth mentionning indeed !


2007-02-19, 7:16 pm

Thank you for your reply Andy and Randy. I looked at the global traansaction section you mentioned, but i have a question regarding global transaction (I apologize for the lack of my knowldege about global transactions). I have a bean, which has a method(
lets say M1) that calls another bean's method(M2). M1 has transaction type of "RequiresNew" and M2 has transaction type of "Required". so, to which bean i should set the larger global transaction timeout to make sure that M2 finishes its work?

And also I have a question about .xmi files the websphere needs. I don't have RAD and i use eclipse for coding. Is there a document that points me to the structure and contents of these files, so that i can hand code them?

Thank you very much for your time and help.

Ana.
Paul Ilechko

2007-02-20, 1:29 am

nywheresoft@yahoo.com wrote:
> Thank you for your reply Andy and Randy. I looked at the global
> traansaction section you mentioned, but i have a question regarding
> global transaction (I apologize for the lack of my knowldege about
> global transactions). I have a bean, which has a method(lets say M1)
> that calls another bean's method(M2). M1 has transaction type of
> "RequiresNew" and M2 has transaction type of "Required". so, to which
> bean i should set the larger global transaction timeout to make sure
> that M2 finishes its work?


In this case M2 will join existing transaction created by M1. I see no
real reason to have different timeouts - give them both sufficient time
that the global transaction can complete.
Andy Wilkinson

2007-02-20, 7:20 am

nywheresoft@yahoo.com wrote:

> I have a question about .xmi files the websphere needs. I don't have RAD and i use eclipse for coding. Is there a document that points me to the structure and contents of these files, so that i can hand code them?


I would recommend using the Application Server Toolkit (ASTK) to
configure this setting rather than writing the xmi files yourself. The
ASTK is included with WAS v6 and later. It's also available to download
for WAS 5.1:

http://www-1.ibm.com/support/docvie...uid=swg24007418

Regards,
Andy
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com