# Job acquisition is not happening in flowable

**URL:** <https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897>\
**Category:** Flowable Engine\
**Created:** [November 15, 2022, 9:57am UTC](https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897 "2022-11-15T09:57:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NEETjam](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@NEETjam](https://forum.flowable.org/u/NEETjam)\
**Post date:** [November 15, 2022, 9:57am UTC](https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897/1 "2022-11-15T09:57:19Z")

</div>

Hi Team,

We have an issue with jobs getting stuck in our engine. Below are the details.

DB : mysql  
Flowable version: 6.7.2  
parameter global-acquire-lock-enabled=true  
Parallel gateway and exclusive gateways have async set and joining parallel gateway has exclusive set.

error details:

org.apache.ibatis.exceptions.PersistenceException:

### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

### The error may exist in org/flowable/job/service/db/mapping/entity/Job.xml

### The error may involve org.flowable.job.service.impl.persistence.entity.JobEntityImpl.insertJob-Inline

### The error occurred while setting parameters

### SQL: insert into ACT\_RU\_JOB ( ID\_, REV\_, CATEGORY\_, TYPE\_, LOCK\_OWNER\_, LOCK\_EXP\_TIME\_, EXCLUSIVE\_, EXECUTION\_ID\_, PROCESS\_INSTANCE\_ID\_, PROC\_DEF\_ID\_, ELEMENT\_ID\_, ELEMENT\_NAME\_, SCOPE\_ID\_, SUB\_SCOPE\_ID\_, SCOPE\_TYPE\_, SCOPE\_DEFINITION\_ID\_, CORRELATION\_ID\_, RETRIES\_, EXCEPTION\_STACK\_ID\_, EXCEPTION\_MSG\_, DUEDATE\_, REPEAT\_, HANDLER\_TYPE\_, HANDLER\_CFG\_, CUSTOM\_VALUES\_ID\_, CREATE\_TIME\_, TENANT\_ID\_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

### Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction.

---

<div class="post-metadata">

**Author:** ![preetishirur1](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@preetishirur1](https://forum.flowable.org/u/preetishirur1)\
**Post date:** [November 15, 2022, 10:06am UTC](https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897/2 "2022-11-15T10:06:09Z")

</div>

Further to above details, i have added error details.

### Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

### SQL: insert into **ACT\_RU\_JOB** ( ID\_, REV\_, CATEGORY\_, TYPE\_, LOCK\_OWNER\_, LOCK\_EXP\_TIME\_, EXCLUSIVE\_, EXECUTION\_ID\_, PROCESS\_INSTANCE\_ID\_, PROC\_DEF\_ID\_, ELEMENT\_ID\_, ELEMENT\_NAME\_, SCOPE\_ID\_, SUB\_SCOPE\_ID\_, SCOPE\_TYPE\_, SCOPE\_DEFINITION\_ID\_, CORRELATION\_ID\_, RETRIES\_, EXCEPTION\_STACK\_ID\_, EXCEPTION\_MSG\_, DUEDATE\_, REPEAT\_, HANDLER\_TYPE\_, HANDLER\_CFG\_, CUSTOM\_VALUES\_ID\_, CREATE\_TIME\_, TENANT\_ID\_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

### The error occurred while setting parameters

### The error may involve org.flowable.job.service.impl.persistence.entity.JobEntityImpl.insertJob-Inline

### The error may exist in org/flowable/job/service/db/mapping/entity/Job.xml

### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

Caused by: org.apache.ibatis.exceptions.PersistenceException:

### Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

### SQL: delete from **ACT\_GE\_BYTEARRAY** where ID\_ = ? and REV\_ = ?

### The error occurred while setting parameters

### The error may involve org.flowable.common.engine.impl.persistence.entity.ByteArrayEntityImpl.deleteByteArray-Inline

### The error may exist in org/flowable/common/db/mapping/entity/ByteArray.xml

### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

Caused by: org.apache.ibatis.exceptions.PersistenceException:

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [November 23, 2022, 9:42am UTC](https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897/4 "2022-11-23T09:42:10Z")

</div>

> [@preetishirur1](#):
>
> Lock wait timeout exceeded; try restarting transaction

This is a MySQL exception, not a Flowable exception. It means that the database is under high load and can’t get a lock to a row it needs in acceptable time, because other transactions have also requested a lock for it.

How is this mysql set up (hardware / configuration wise)?

---

<div class="post-metadata">

**Author:** ![preetishirur1](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@preetishirur1](https://forum.flowable.org/u/preetishirur1)\
**Post date:** [November 24, 2022, 4:51am UTC](https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897/5 "2022-11-24T04:51:29Z")

</div>

HI Joram,

Here i mentioned the configuration of our MySQL DB and also the memory and CPU details of the production server.

**Mysql parameters** -

#server#####:~ # cat /etc/my.cnf

# For advice on how to change settings please see

# [http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html](http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html)

[mysqld]

# 

# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb\_buffer\_pool\_size = 128M

# 

# Remove the leading "# " to disable binary logging

# Binary logging captures changes between backups and is enabled by

# default. It’s default setting is log\_bin=binlog

# disable\_log\_bin

# 

# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join\_buffer\_size = 128M

# sort\_buffer\_size = 2M

# read\_rnd\_buffer\_size = 2M

# 

# Remove leading # to revert to previous value for default\_authentication\_plugin,

# this will increase compatibility with older clients. For background, see:

# [https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar\_default\_authentication\_plugin](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin)

# default-authentication-plugin=mysql\_native\_password

#datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

basedir=/data/mysql

datadir=/data/mysql/data

lc\_messages\_dir=/data/mysql/share

lc\_messages=en\_US

socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysql/mysqld.log

pid-file=/var/run/mysql/mysqld.pid

log-bin=/data/mysql/log/mysql-bin

#log-error=/var/log/mysql/mysqld.log

#pid-file=/var/run/mysql/mysqld.pid

expire\_logs\_days=30

# MySQL log files

# Errors Including Startup Errors

log-error=/var/log/mysql/mysqld.log

# all queries, This log will grow quickly

#log=/var/log/mysql/mysql.log

# all queries, This log will grow quickly

general\_log=1

general\_log\_file=/var/log/mysql/mysql.log

# queries that take a long time (in this case over 1 second as specified below)

#log-slow-queries = /var/log/mysql/mysql-slow.log

long\_query\_time = 1

slow\_query\_log=1

slow\_query\_log\_file=/var/log/mysql/mysql-slow.log

# Purge flushed binary logs over 30 days = 30_24_60\*60 seconds

binlog\_expire\_logs\_seconds=2592000

###To enhance mysql performance as per play and test

innodb-buffer-pool-size=21474836480

innodb\_buffer\_pool\_instances=20

innodb\_log\_file\_size=4294967296

sort\_buffer\_size = 50M

read\_rnd\_buffer\_size = 50M

join\_buffer\_size = 256M

innodb\_log\_buffer\_size = 167772160

innodb\_sort\_buffer\_size = 10485760

innodb\_read\_io\_threads = 16

innodb\_write\_io\_threads = 16

innodb\_status\_output = ON

innodb\_status\_output\_locks = ON

innodb\_rollback\_on\_timeout = ON

**server details:**  
Platform : Google x86\_64  
Total CPU : 32 CPUs Total Memory : 128923 MB  
OS Release : SLES 12 SP5 OS kernel : 4.12.14-122.136-default

Let me know if you need any further details.

Regards,  
Preeti Shirur

---

<div class="post-metadata">

**Author:** ![preetishirur1](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@preetishirur1](https://forum.flowable.org/u/preetishirur1)\
**Post date:** [November 28, 2022, 11:09am UTC](https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897/6 "2022-11-28T11:09:21Z")

</div>

Hi Joram,

I am closing this thread and opening other one for lock owner issue.

Regards,  
Preeti Shirur

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [November 29, 2022, 8:12am UTC](https://forum.flowable.org/t/job-acquisition-is-not-happening-in-flowable/9897/7 "2022-11-29T08:12:52Z")

</div>

Just scanning through the settings, that’s 21GB RAM (innodb-buffer-pool-size), right?
