1 Reply Latest reply: Mar 15, 2013 3:05 PM by TPD-Opitz RSS

    Lock wait timeout exceed

    996004
      public boolean addQualification(List<Qualification> qualificationList) throws SQLException{

      String sql="insert into Qualification(QID,EID, Qualification) values (?,?,?)";
      boolean add=false;
      for(Qualification qualification:qualificationList){
      Object [] data={qualification.getQid(),qualification.getEid(),qualification.getQualification()};
      int result=DBHandle.setData(connection, sql, data);
      if(result>0){
      add=true;
      }else{
      add=false;
      connection.rollback();
      break;
      }
      }

      return add;

      }
      When i run this code i got "java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction" exception

      How can i fix it??

      Thank You!
        • 1. Re: Lock wait timeout exceed
          TPD-Opitz
          993001 wrote:
          How can i fix it??
          At first you could start using
           tags to format your example.
          
          At secound you could ask this in the proper sub-forum: This is a database error so it would have better fit here:
          SQL and PL/SQL
          
          And finally:
          You try to concurrently update the same entry in database from different sessions. You should call <tt>connection.commit()</tt> where your business logic completes a transaction.
          
          bye
          TPD