I’m having an issue when trying to update a single user orm object. Its an intermittent problem.
The coldbox code for login.cfc is
user.setIsOnline(0);
user.setDateLastActivity(now());
user.setLoginUUID(’’);
userService.save(entity=user,flush=true);
Essentially the user is trying to logout. Nothing special at all.
However this captured error below is happening randomly throughout my entire application. No rhyme or reason from what I can tell. Sometimes its when I’m adding a record. Sometimes its when I’m updating. And sometimes its when I’m deleting.
I’m using Microsoft SQL Server 2005 database. With Microsoft SQL Driver configured as below
this.datasources[“al3data”] = {
, connectionString: ‘jdbc:sqlserver://255.255.255.255:1433;DATABASENAME=data;sendStringParametersAsUnicode=true;SelectMethod=direct;useUnicode=true;characterEncoding=UTF-8’
This problem is happening in most areas of my application. Here is another example where I’ve wrapped all updates around a transaction {}
Here is images.cfc snippet that is breaking
transaction {
switch(event.getValue(‘action’)){
case “delete”:
var data = imageService.findAllWhere(criteria={imageID=event.getValue(‘imageID’)});
if(arrayLen(data)){
imageService.delete(entity=data[1]);
}
break;
}
}
Stack Trace is below.
It seems like no matter if I wrap in transaction {} or use {orm}Service.save/delete(entity=val,flush=true) method it throws the same error. Now the funny thing is this appears to only be happening on Microsoft SQL Server 2005 database. The other database I have which is MySQL, I’m not seeing this same behavior.
Any help/guidance/suggestions…heck at this point, I’ll take guessing. I feel like there is something wrong with the way I have mssql configured but its also a fresh install with the latest updates.
Stack Trace:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85):85
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70):70
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:47):47
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2691):2691
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2895):2895
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97):97
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267):267
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:259):259
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:183):183
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321):321
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51):51
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206):1206
at lucee.runtime.orm.hibernate.HibernateORMTransaction.end(HibernateORMTransaction.java:63):63
at lucee.runtime.orm.ORMConnection.setAutoCommit(ORMConnection.java:208):208
at lucee.runtime.db.DatasourceManagerImpl.end(DatasourceManagerImpl.java:251):251
at lucee.runtime.tag.Transaction.doFinally(Transaction.java:155):155
at modules.slam.handlers.images_cfc$cf.udfCall(/modules/slam/handlers/images.cfc:124):124
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:216):216
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:643):643
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1778):1778
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:773):773
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1603):1603
at coldbox.system.web.controller_cfc$cf.udfCall2(/coldbox/system/web/Controller.cfc:548):548
at coldbox.system.web.controller_cfc$cf.udfCall(/coldbox/system/web/Controller.cfc):-1
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:216):216
at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:775):775
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:773):773
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1603):1603
at coldbox.system.web.controller_cfc$cf.udfCall2(/coldbox/system/web/Controller.cfc:425):425
at coldbox.system.web.controller_cfc$cf.udfCall(/coldbox/system/web/Controller.cfc):-1
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:216):216
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:643):643
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1778):1778
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:773):773
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1603):1603
at coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:197):197
at coldbox.system.bootstrap_cfc$cf.udfCall(/coldbox/system/Bootstrap.cfc):-1
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:766):766
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1593):1593
at coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:353):353
at coldbox.system.bootstrap_cfc$cf.udfCall(/coldbox/system/Bootstrap.cfc):-1
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:642):642
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1761):1761
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1593):1593
at application_cfc$cf.udfCall(/Application.cfc:103):103
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:642):642
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1761):1761
at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:407):407
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:133):133
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:38):38
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2265):2265
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2228):2228
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:47):47
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729):729
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291):291
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239):239
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219):219
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106):106
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502):502
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142):142
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79):79
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88):88
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518):518
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091):1091
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668):668
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527):1527
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484):1484
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
at java.lang.Thread.run(Thread.java:745):745