Greetings,
We are running LAMS 2.3.1 on RH EL5 with a MySQL 5.1.31. We are trying to setup 3 instances running on separate servers (no session replication) with a single DB using Apache mod_proxy and mod_proxy_ajp to handle the load balancing across the instances. Everything seems to be working well with one major exception. When a user submits a response, a DataIntegrityViolationException error is thrown. The full stack is:
2009-11-16 09:50:31,361 [TP-Processor12:] FATAL org.lamsfoundation.lams.web.util.CustomStrutsExceptionHandler - org.springframework.dao.DataIntegrityViolationException: Hibernate transaction synchronization: Could not execute JDBC batch update; SQL [insert into tl_laqa11_usr_resp (answer, hidden, attempt_time, visible, time_zone, qa_que_content_id, que_usr_id, response_id) values (?, ?, ?, ?, ?, ?, ?, ?)]; Duplicate entry '13290' for key 'PRIMARY'; nested exception is java.sql.BatchUpdateException: Duplicate entry '13290' for key 'PRIMARY'
java.sql.BatchUpdateException: Duplicate entry '13290' for key 'PRIMARY'
If we disable 2 of the 3 servers, this error goes away. I'm not very familiar with Hibernate but it seems like the the primary key being generated by Hibernate rather than MySQL on insert.
I came across this bug http://bugs.lamsfoundation.org/browse/LDEV-1973 which seems related but has nothing to do with multiple instances of LAMS running simultaneously against the same DB.
Thanks in advance for any suggestions,
Bill
Posted by William Holloway