1 Reply Latest reply on Aug 25, 2001 12:47 AM by David Jencks

    javax.transaction.HeuristicRollbackException

    Boon Hian Tek Newbie

      Hi,

      I am writing a Database Access Object that
      has a method that executeQuery on a stored
      procedure on a Sybase 12.5.

      The DAO is being called from within a
      StateLess EJB. Somehow whenever I execute
      the query, the method dies because of
      some uncommented HeuristicRollbackException,
      any clue?

      The stored procedure creates a number of
      temporary table to do a complicated search.
      Could it be that those DDL statements
      are being commited automatically by the
      database, thus causing JBoss to lose its
      ability to control the transaction?

      Any clues?

      Thanks!

      Boon

        • 1. 3463
          David Jencks Master

          It should be pretty easy to investigate if your suggestion is the problem. If not, make sure you are not trying to hold onto a connection over transaction boundaries and that you are closing it before the end of the transaction.

          [transaction starts]
          Connection c = ds.getConnection();
          try {
          ..do work
          ..close resultsets and statements
          }
          finally {
          c.close();
          }
          [transaction ends]