0 Replies Latest reply on Nov 10, 2003 10:11 AM by gue13

    database-transactions and locking

    gue13 Newbie

      hi all,

      my scenario:

      a sfsb with 2 business methods and one transaction (using exaclty one database-connection from pool)

      - business method 1 does a
      "select for update" to lock a record

      - business method 2 does a
      "update ..." to change the record.

      the VERY strange thing is:

      business method 1 locks the record as designed. then i open a sql-plus-window and type "select * from ... for update of ..." => this statement will wait until the record is available for update again.

      when business-method 2 is invoked, sql-plus-window gets the record, for update!!! if i rollback the transaction (in sql-plus-window) then business-method 2 updates the record as asumed.

      i guess, even if i use only one CON (conneciton) for all of my db-statements, jboss handels the connections internally, therefor using many different database-sessions, right?

      But, and all people working with databases know exactly what i mean, a "transaction" in a database means select, locking, update all in one database-session, ending up with commit or rollback.

      whats the understanding of a transaction in jboss?
      does jboss commit/rollback ALL database-sessions used as one logical connection? if this is true, database locking will not work properly!

      kind regards