Thanks Simon, it worked.
My objective is to control the passivation of the
beans by setting the transaction boundaries using the
methods UserTransaction.begin() and
UserTransaction.commit(). The bean should not get
passivated during this transaction period. However, I
find that JBoss passivates my bean, eventhough it is
in the midst of a transaction.
The reason why I do not want the bean to get
passivated:
It is a stateful session bean having a DataSource
connection, which I need to maintain throughout the
lifetime of the application for the user to be able to
move through the record set. Otherwise, since I am
using a database format (DDS in AS/400) which does not
have any unique keys, it is not possible to maintain
the current cursor position.
I thought by demarcating the boundaries of the
transaction, I will be able to avoid the passivation
of the bean. But now, it seems JBOss is passivating
the bean in spite of having a transaction associated
with it.
Is it not possible to control passivation in JBoss by
using bean managed transactions?
Thanks,
Sujith S Pillai.
From: "Bordet, Simone" <[EMAIL PROTECTED]>
To: "JBoss User Mailing List (E-mail)"
<[EMAIL PROTECTED]>
Date: Wed, 4 Apr 2001 22:39:11 +0100
Subject: [JBoss-user] RE: [JBoss-dev] Transaction
timeout
Reply-To: [EMAIL PROTECTED]
Hey,
look in jboss.jcml and almost at the top there is the
transaction =
mbean. You
will find there the transaction timeout value, that
overrides the one =
in the
code.
Simon
> -----Original Message-----
> From: sujith s.pillai. [mailto:[EMAIL PROTECTED]]
> Sent: mercoled=EC 4 aprile 2001 21:48
> To: [EMAIL PROTECTED]
> Subject: [JBoss-dev] Transaction timeout
>=20
>=20
> Hi,
>=20
> I am not sure whether this is the right forum for
> posting this doubt. I have already sent this to
jboss
> users' forum. Sorry for the cross-posting.
>=20
> I am running JBoss 2.1 alongwith Jetty 3.0.2 / JDK
> 1.3.
>=20
> We have a stateful session bean running with bean
> managed transaction. It has got the transaction
> boundaries set as follows:
> getFirstName() is where the transaction is initiated
> by UserTransaction.begin(). In getNextName(), the
> transaction is committed by
UserTransaction.commit().
>=20
> Now, the two methods are invoked by two different
> servlets. When the user calls the first servlet, it
> calls the bean's getFirstName() method, and fetches
> the values for us. When the user clicks on the
"Next"
> button on the form, the second servlet is invoked,
and
> it calls the bean's getNextName() and fetches the
> required values; and commits the transaction.
>=20
> Our problem is, when the user invokes the first
> servlet, and then, chooses to remain idle for more
> than 5 minutes, the transaction gets timed out, and
> then, if we try to invoke the second servlet, it
gives
> a RollbackException in the getNextName().
>=20
> This is because the org.jboss.tm.TxManager class has
> got the timeout value hard-coded in it as :
> ----START OF JBOSS SOURCE CODE-------------
>=20
> /**
> * Default timeout in milliseconds.
> * Must be >=3D 1000!
> */
> long timeOut =3D 5*60*1000;=20
>=20
> ----END OF JBOSS SOURCE CODE---------------
>=20
> Because of this, we cannot let the user remain idle
> for more than 5 minutes.
>=20
> However, our application, which is a conversion
> project from AS/400, needs to have the timeout set
to
> a higher limit as in the earlier AS/400 version of
the
> application.
>=20
> Can we change this timeout value in the
> org.jboss.tm.TxManager class, without affecting
> anything else?
>=20
>=20
> Thanks,
> Sujith.
>=20
> Additional info:
>=20
> From the org.jboss.tm.TxCapsule class:
>=20
> ------------JBOSS SOURCE CODE-----------------------
> /**
> * Create a new TxCapsule.
> *
> * @param tm The transaction manager for this
> transaction.
> * @param timeout The timeout for this
transaction
> in milliseconds
> * (timeouts are not yet
> implemented).
> */
> TxCapsule(TxManager tm, long timeout)
> {
> this(tm);
>=20
> status =3D Status.STATUS_ACTIVE;
>=20
> start =3D System.currentTimeMillis();
> this.timeout =3D
> TimeoutFactory.createTimeout(start+timeout, this);
> branchXids =3D new HashMap();
> }
> ----------END OF JBOSS SOURCE
CODE--------------------
>=20
>=20
>=20
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user