It's all about the answers!

Ask a question

Build Forge persistent query resulting in Table Lock


Adrian Seady (111) | asked Feb 21 '12, 1:47 p.m.
There is a query that is stuck in the "preparing" state in our Build Forge MySQL database. It appears that the query itself is truncated:

UPDATE bf_buildenventry SET bf_default_id=NULL where bf_env_id IN (SELECT bf_id FROM bf_buildenv WHE


I tried restarting our Build Forge instance but the query reappears. I tried killing the query on the database but it reappears after a couple of seconds.

This query is causing table locks to appear when trying to interface with Build Forge e.g. deleting a schedule. I verified this by trying to delete a schedule through the management console and it returned:

CRRBF0558I: Failed SQL query: [org.apache.commons.dbcp.DelegatingPreparedStatement@14aa14aa] => [java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction


After killing the suspect query. I was able to delete the schedule.

I took a look at our Build Forge logs and found this occurring at regular intervals:

Feb 16, 2012 10:54:51 AM com.buildforge.services.server.db.DBConnection errorQueryFailed

WARNING: SQL 1310871074 query failed
Throwable occurred: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
near 's FROM bf_store s INNER JOIN bf_buildenventry bee ON bee.bf_value_store=s.bf_id ' at line 1
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2024)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1449)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
at com.buildforge.services.server.db.DBConnection.executeBatch(DBConnection.java:1287)
at com.buildforge.services.server.manager.BuildEnvironmentManager.deleteBulk(BuildEnvironmentManager.java:254)
at com.buildforge.services.server.manager.BuildManager.purgeBuildRecord(BuildManager.java:1220)
at com.ibm.jas.mjc.server.purge.PurgeThread.purgeBuildRecord(PurgeThread.java:316)
at com.ibm.jas.mjc.server.purge.PurgeThread.purge(PurgeThread.java:123)
at com.ibm.jas.mjc.server.purge.PurgeThread.run(PurgeThread.java:343)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)


I have no idea where this query is coming from nor why Build Forge is trying to pass a syntactically incorrect query to the MySQL database. Any suggestions or requests for additional information are welcome. Need help!

One answer



permanent link
Robert haig (1.0k16) | answered Mar 01 '12, 6:10 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
You should contact support.

If buildforge is not passing the entire query to your DB, then there is something wrong with your instance of BF.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.