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,
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?
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.
Connection c = ds.getConnection();
..close resultsets and statements