So not too much. I have a test page in the main application (/index.cfm) that runs:
And I have an angular test page that hits the taffy side 10 times.
I’ll then switch back and forth between environments. Eg. Run ten from main app, run 10 from angular, run 10 again from main app - an here is where I’ll see the error. Looking at the hibernate log, I see that it’s not running a
when I return to running the main app test. Here’s the hibernate log:
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
select
max(UserLoginID)
from
UserLogins
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:12 [catalina-exec-3] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-1] HIBERNATE DEBUG -
select
max(UserLoginID)
from
UserLogins
04/06 11:16:24 [catalina-exec-1] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-9] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-10] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-2] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-11] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-12] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-9] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-6] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-2] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:24 [catalina-exec-1] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
??? SHOULD HAVE ANOTHER SELECT MAX HERE ???
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE DEBUG -
insert
into
UserLogins
(DateTime, UserID, UserLoginID)
values
(?, ?, ?)
04/06 11:16:32 [catalina-exec-7] HIBERNATE ERROR - Duplicate entry '20' for key 'PRIMARY'
04/06 11:16:32 [catalina-exec-7] HIBERNATE ERROR - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:179)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at coldfusion.orm.hibernate.SessionWrapper.flush(SessionWrapper.java:176)
at coldfusion.orm.hibernate.HibernateSessionManager.flushSession(HibernateSessionManager.java:217)
at coldfusion.orm.hibernate.HibernateSessionManager.flushAllCurrentSessions(HibernateSessionManager.java:271)
at coldfusion.orm.hibernate.HibernatePersistenceManager.onPageRequestEnd(HibernatePersistenceManager.java:1038)
at coldfusion.orm.hibernate.HibernatePersistenceManager$HibernateEventListener.onPageRequestEnd(HibernatePersistenceManager.java:1155)
at coldfusion.filter.ApplicationFilter.firePageRequestEnd(ApplicationFilter.java:610)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:475)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:151)
at coldfusion.CfmServlet.service(CfmServlet.java:204)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.sql.BatchUpdateException: Duplicate entry '20' for key 'PRIMARY'
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1819)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1281)
at coldfusion.server.j2ee.sql.JRunStatement.executeBatch(JRunStatement.java:340)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 47 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '20' for key 'PRIMARY'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)
at com.mysql.jdbc.Util.getInstance(Util.java:372)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1777)
... 51 more
I’m not totally sure what more to pare down, but I’ll keep looking. Thanks again for the help, and let me know if I can do something else to provide more info.