Strange problem when using Transaction with ormenablle true

Description

I have a simple cfc file (test.cfc) like this:

component
persistent="true"
output="false"
{

property name="thename" type="string"

}

after that in my cfm file I do call like this:

myTest = new test();
wequery = new Query();
sql = "INSERT INTO TData
(data)
VALUES
('Hello')";

wequery.setSQL(sql);

transaction{
myTest.setthename('name');
wequery.execute();
}

this will return error:
"this feature is not supported<br>The error occurred on line 110 in file /org/lucee/cfml/Base.cfc."
If I remove the transaction, then this is working fine.

Or If the code like this:

transaction{
wequery.execute();
}

this is work fine too.

FYI, if I set this.ormEnabled = false, then no error. So it seems lucee still have bug ith ORM things ?

Environment

Strange problem when using Transaction. Currently I use lucee 5.2.4.37 with MSSQL as database. My application has setting this.ormEnabled = true

Activity

Show:
Seth Johnson
July 26, 2019, 7:06 PM

This is a blocker for us as well, would love to see it resolved after a few years now of running into this.

Adam Tuttle
February 14, 2020, 9:37 PM

(and everyone else) ~ We've found that running a simple "select 1" achieves the same result (able to work around this bug).

Adam Tuttle
February 17, 2020, 7:07 PM

Update: It seems that while the above query does stop Lucee from throwing an exception due to mixed ORM and SQL queries in the same transaction block (by running SQL first), the ORM changes don't get committed at all. We've had to start jumping through a few extra hoops to split SQL and ORM actions into separate transactions entirely in order to accomplish our needed changes.

In my mind, this has just become a much more severe bug.

Samuel W. Knowlton
February 17, 2020, 7:11 PM

We had to add ORMFlush() to the end of many transactions involving HQL and SQL. It was frustrating, since the whole point of using transactions (with flushAtRequestEnd = false) is to handle the Hibernate session for you.

Our ‘solution’ to this ticket was to move away from CFORM in favor of Quick and QB. It’s a multi-year process but ultimately Lucee has ceded the field on Hibernate support to Adobe. One could make the case that this is for good reason, but it’s become one of those things that “everybody knows” that if your app is ORM-heavy, switching to Lucee will be far more difficult than if you weren’t using Hibernate.

Adam Tuttle
September 22, 2020, 9:26 PM

It sure would be nice if someone from LAS would even acknowledge this bug.

Assignee

Michael Offner

Reporter

Andri Senjaya

Priority

Major

Labels

Fix versions

None

Affects versions

Configure