I have a CF10 app using cf-orm. I have auto flushatrequestend = false, so in the orm entities I have a save() method like
public function save()
{
var trans = OrmGetSession().beginTransaction();
try
{
EntitySave(this);
trans.commit();
}
catch(Any exc)
{
trans.rollback();
rethrow;
}
}
Intermittently, I'll get an error "batch update returned unexpected row count from update". Things will be running fine, then I might get several of these over the course of 20-30 minutes, then back to normal.
From google searching on that error, I gather it's a hibernate error but I'm not sure why it's happening and how to resolve.
Also, while digging into this I was looking at the fusion reactor jdbc logs. I can see the update query that runs and it looks fine. But then looking at some of the queries running before that update I see a bunch of selects that FR says return 0 rows but the should always return rows. For example, a simple query like
select ordertype0_.orderTypeID as orderTyp1_14_0_, ordertype0_.name as name14_0_, ordertype0_.sortOrder as sortOrder14_0_ from orderTypes ordertype0_ where ordertype0_.orderTypeID=4
Why would cf-orm return 0 rows??
-Phil
struct
Cause:
[struct]
Message: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
StackTrace: org.hibernate.StaleStateException: 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)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:47)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2574)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(Abst