2 Replies Latest reply on Aug 28, 2001 2:47 PM by Alex Alex

    Problems with Session Beans and Persistence

    Alex Alex Newbie

      Hi Folks,

      I'm having some problems with the JBoss connection pool/hypersonic and stateful beans. I'm using JBoss 2.2 and I have deployed and Stateful Session bean. The bean uses Container Managed Transaction for all methods in the remote interface (the transaction attribute in the descriptor is TX_REQUIRED). Each of these methods follows the logic below:

      1 - get a connection from the pool
      2 - do some jdbc stuff
      3 - close connection

      This should be fine, since I'm acquiring and releasing the connection in the same transaction context. However, step 3 (closing the connection) corrups the database. I tried removing it, but my problems now are occurring in the passivation. The ejbPassivate method closes the connection (in order to return it to the pool) and sets the instance variable to null. But again, when the connection is closed, the hypersonic database gets corrupted (with repeated old data, as if it where commiting old transactions).

      Has anybody had similar problem? How can I fix this?

      Thanks
      Alex