[jboss-user] SFSB "different tx context" transaction error on jboss 4.2.X

Will Milspec will.milspec at gmail.com
Mon Nov 23 15:23:39 EST 2009


Hi all,

We have an transaction error that has recently appeared consistently:  a
stateful session bean (SFSB) has an application error and throws an
exception. The next time the application tries to use the stateful session
bean it gets an error:

tried to enter Stateful bean with different tx context,
contextTx: TransactionImple
      < ac, BasicAction: a640128:983:4af49b0f:299 status:
ActionStatus.RUNNING >,
methodTx: TransactionImple
     < ac, BasicAction: a640128:983:4af49b0f:348 status:
ActionStatus.RUNNING >

Revewing the ejb literature, I see that if the SFSB throws a SystemException
(eg. EJBException) w, cause the app server will discard the SFSB instance.
Currently the SFSB throws an application exception. This seems like a
straightforward fix.

This code has been in place for a few years, and we've been running jboss
4.2. for a few years. So we're a bit puzzled "why now?"

One change: we have recently upgraded the jdbc drivers (mssql) from to
microsoft's version 1.1 to  2.0. The 1.2-and-later-driver handles
transaction-id's-in-the-jdbc-connection differently than the earlier 1.1
drivers. (The jdbc connection implementation actually keeps a reference to
the current transaction id in the database. After we upgraded the driver, we
saw another problem where bad exception handling kept a stale 'mssql
transaction id' around in the jdbc connection. Properly closing the result
set/stmt/connection upon error solved this jdbc
transaction-id-hanging-around problem).

After reviewing the jboss 4.2.3 code, however, I suspect that the 'jdbc
driver version' change may in not in fact pertain at all to our stateful
session bean problem, i.e. it's a 'red herring',.  The
arjuna/user-transaction/statefulsession code does not even touch the jdbc
driver.  Unless I missed something

So a few follow-in questions. Can anyone comment/weigh-in/opine/pontificate:
* whether they've seen this issue?
* throwing EJBException's will solve this problem
* comment
* any tips for debugging solving these types of problems?

thanks,

bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20091123/ae05df3c/attachment.html 


More information about the jboss-user mailing list