Could not execute JDBC batch update - SQL Error 1598, SQLState HY000

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

This error message appears on the screen:

Your request was unable to be processed
org.hibernate.exception.GenericJDBCException - Could not execute JDBC batch update

This message appears in the logs:

2012-05-16 14:27:30,937 WARN  [btpool0-10 ] org.hibernate.util.JDBCExceptionReporter org.hibernate.util.JDBCExceptionReporter-logExceptions - SQL Error: 1598, SQLState: HY000
2012-05-16 14:27:30,938 ERROR [btpool0-10 ] org.hibernate.util.JDBCExceptionReporter org.hibernate.util.JDBCExceptionReporter-logExceptions - Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
2012-05-16 14:27:30,939 ERROR [btpool0-10 ] org.hibernate.event.def.AbstractFlushingEventListener org.hibernate.event.def.AbstractFlushingEventListener-performExecutions - Could not synchronize database state with session

Cause

There is an incompatibility between using InnoDB with transaction isolation level READ-COMMITED and the binlog format STATEMENT because READ-COMMITED only supports row-based binary logging.

Background: 
  • Atlassian products were created  to use a transaction isolation level of READ-COMMITED when utilizing a MySQL database because of a known MySQL bug.
  • Atlassian recommends using InnoDB as the default storage engine instead of MyISAM (which is the MySQL default) because MyISAM doesn't support foreign key constraints (read more about this known issue).
  • MySQL changed the default binlog format for 5.1 to STATEMENT.

Resolution

Use binlog_format=ROW instead of binlog_format=STATEMENT. In order to change to row-based binary logging set the following in /etc/my.cnf:

binlog_format=row

Users have reported that the following also works:

binlog_format= mixed
Last modified on Feb 14, 2013

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.