1 Reply Latest reply on Oct 29, 2002 9:57 AM by Rajesh S

    Database Locking problem with SL Server

    Rajesh S Newbie

      I am using JBOSS 2.4.4 with JSQLConnect driver to connect to SQl Server 2000 database.
      I have two scenarios to illustrate my problems which involves around the Connection object got using the datasource.
      1. I am calling a Stored procedure(SP) to extract some data for reporting purposes when i run the Stored procedure in the query analyzer it takes few seconds but when i run from my stateless session bean it takes minutes. The same SP takes just a few seconds when i create my own connection. By the way the I am using Transaction Not Required attribute.
      2. In another scenario i have a stateless session bean which calls a SP that does some updates (some large chunk of data update) and i have specified the transaction attribute as 'Required' for this method and the problem is that the SP takes a few seconds to do this thru the query analyzer but when invoked from the bean it takes minutes.
      Can anyone suggest solutions to this.

      Thanks in advance

        • 1. Re: Database Locking problem with SQL Server
          Rajesh S Newbie

          Well we were able to overcome the lock problems by changing the datasource from XA to JDBCDataSource. It is sufficient to use the JDBCDatasource as i do not jave multple datasources.
          Now i have a peculiar problem when i use JDBCDataSource - When an exception happens in my Stateless Session Bean with Container managed Transaction the log says that it is rolling back and also throws a TransactionRolledBackException. But in reality the data has been committed to the Database. I tried debugging by stepping thru the code and found that TxCapsule's rollback method is called which in turn calls rollbackResources but the problem is that the resourceCount variable is 0 so nothing gets really rolled back. Moreover the addResource method is also not called, i think the whole implementation of the transaction manager in JBOSS 2.4.4 is XA Resource oriented. Can someone throw light or tell me if i am missing something here. How can i get going without having to use XA Resources for my transactions.