Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002

    Unanswered: update multiple files using one jdbc connection

    I am using mysqlmax3.23.49 and mm.mysql-2.0.4 jdbc driver.

    I have two mysql tables of type INNODB. lets say table A and table B.
    acode is the primary key of table a. primary key of table B is acode + bcode. therefore acode is the foriegn key.

    After intiating the data base connection i set auto commit false using setautocommit(false).
    Then i insert a record to table B. before commiting the transaction i tried update a record in table A.
    the program gives the following exception

    "add error java.sql.SQLException: General error: Lock wait timeout exceeded; Try restarting transaction

    then the transaction roll backs.(according to the program)

    What is cause of this error. how shall i overcome that.

  2. #2
    Join Date
    Feb 2001
    NC, USA
    As long as the transaction is in the same session, this shouldn't cause a problem. It seems as if the java app is starting a new session for the second update. Try the same process manually from a command prompt.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts