简体   繁体   中英

DB2 JDBC Driver (Type 4) hangs on Execute()

I am executing a series of sql statements using a JDBC connection on a DB2 server. On the last execute() of the simple sql: DELETE FROM MYTABLE , the thread gets hung for a long period of time even if the table somply contains a single record.

The application server I am using is WAS. I wonder if this is an issue specific to WAS and DB2 combination as the same code works on other environments.

Does anybody have any idea what is going on here?

Have you issue the command directly from the CLP? It could be other problem such as:

  • Transaction log problem: There are a lot of rows to delete, and this takes time. Also, the transaction logs have reached the limit, and the database does not do a rollback but waits for empty log freed by other transactions.
  • Lock problem (concurrency): some of the rows your are trying to delete have locks in other transactions, and the applications has to wait to release them (lock wait)

Also, try to do frequent commits.

Deleting rows in a database can be a terrible work: don't forget the database server will log all the data of the table in case of a ROLLBACK. Then I assume the problem is coming from the database especially if the table has many rows.

Have you tried to run manually all the SQL requests yourself in an interactive environment?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM