0 Replies Latest reply on Jul 16, 2002 6:59 AM by georges

    Transaction locks

    georges

      Hi!

      I'm using JBoss 2.4.4. I have the problem that when I use a Session Bean with a Usertransaction the Transaction gets a Transaction timeout because it locks.

      the code is like this :

      transaction.begin();
      tax.setStringAttribute("itemnumber",String.valueOf(de.xifs.database.SQLStatement.getNextPostingIndex(data));
      this.insertPostinginput(tax);

      BeanData netto = tax;
      netto.setStringAttribute("itemnumber",String.valueOf(de.xifs.database.SQLStatement.getNextPostingIndex(data));
      // it locks here
      netto.setStringAttribute("accountnumber",data.getStringAttribute("contraaccount"));
      netto.setDoubleAttribute("currencyamount",new Double(currencyNettoAmount));
      netto.setDoubleAttribute("local1amount",data.getDoubleAttribute("local1amount"));
      this.insertPostinginput(netto);
      // commit the transaction
      transaction.commit();

      The Method getNextPostingIndex executes a Select to a DB2.
      The Select is: Select Max(itemnumber) from xifs.posting;
      The Select is executed via myConnect.createStatement().executeQuery(theQuery). myConnect is hold by reference an used for both selections.

      Where could be the problem?

      Greetings
      Dan