I don't know that transaction attributes necessarily default to Required --
why don't you specify it to make sure? (Unless you are certain the spec says
this -- I just did a quick browse and couldn't find it.) This will insure
the method is not running with the unspecified transaction context.
As far as your exception goes ... I believe it indicates the 2-phase commit
protocol is being used. This is my guess on what is happening (based on my
recollections of distributed transactions): It looks like your transaction
starts but is never terminated. The second time a message is sent to the
DBMS (within the context of the same transaction), a
HeuristicRollbackException is thrown, indicating the DBMS chose not to wait
for the 2-phase commit protocol to complete, but instead unilaterally
decided to rollback ... thus the HeuristicRollbackException. The next method
invocation works fine because it is a new transaction.
Now, I have no idea **why** this is happening ... I'm not very familar with
JBoss. I'd start by explicitly setting the transaction attribute to
Required.
Laurel
-----Original Message-----
From: Mishkin, Ernest [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 02, 2001 12:45 PM
To: [EMAIL PROTECTED]
Subject: JBoss - HeuristicRollbackException
** Tried to post this to JBOSS-USER forum but didn't get any feedback... **
Hello folks,
Kind of new to the EJBs in general and JBoss in particular, so please bear
with me if the question is dumb.
I have a simple stateless session bean with one business method that
executes a query (SELECT) agains Oracle 7.3 database. ejb-jar.xml sets
transaction to container-managed but does not explicitly define transaction
type (which defaults to "Required", doesn't it ?). I also have a connection
pool with 1 min. and 10 max. connections.
Now the problem: if I invoke the bean for the fisrt time, works fine. If I
then make next invocation after a long period of time, I'm getting
HeuristicRollbackException. Subsequent call works again. I realize something
is happening with JDBC Connection but can't figure out what exactly and why.
I know that oracle session itself doesn't get killed.
Any advices will be appreciated !
Regards,
Ernest
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".