?bug with ORM/HQL call and Taffy

Hi all,

I’m coming across a bit of a problem and not sure what’s going on.

If i run the following query via Taffy REST service, I get no results.

If it run it via a normal CFC, I get lots of results.

If i run it via Taffy but remove the activeae and activene parts
(booleans), then it returns the correct results. I’ve tried activeae=true
and activeae=1 with same results.

Any thoughts on what could be going on? Is it a Taffy bug? Or a
hibernate/ORM one? I’m including my Application cfc files below. Running Lucee
4.5.1.000 final and Postgresql 9.

Thanks,
Cage

var orsforpod = ormExecuteQuery(“select distinct t2 from roomsettings t2
where t2.validfor=:validfor
and t2.orpodid=:orpodid
and (t2.activeae=‘t’ or t2.activene=‘t’)”,
{validfor=validfor, orpodid=orpodid});

My taffy is in my approot/apiv1/ directory with the following Application.cfc:

component extends=“taffy.core.api”{
this.name = “myappnameapi”;
this.ormEnabled = true;
/* ORM Setting not suggested for production use*/
this.ormsettings = {datasource = “db_dev”, cfclocation = “…/models”, eventhandling = true};

header name="Access-Control-Allow-Origin" value="*";

variables.framework = {};
variables.framework.serializer = "myappname.server.apiv1.resources.CustomRepresentationClass";

variables.moment = createobject(‘component’,‘myappname.server.utils.moment’);

function onApplicationStart()
{
    application.anythingToXml = createObject("component", "taffy.anythingtoxml.AnythingToXML").init();
    application.ormsettings = this.ormsettings;
    return super.onApplicationStart();
}

function onRequestStart()
{
    return super.onRequestStart();
}

}

My models are in approot/models/ directory.

My application is in approot/ directory with the following Application.cfc

component {

this.name=“myappname”;
this.clientmanagement=“true”;
this.sessionmanagement=“true”;
this.setclientcookies=“true”;
this.setdomaincookies=“false”;
this.sessiontimeout=createTimeSpan(0,2,0,0);
this.applicationtimeout=createTimeSpan(1,0,0,0);
this.loginstorage=“session”;
this.ormEnabled = true;
this.mappings[“models”] = getDirectoryFromPath(getCurrentTemplatePath()) & “models”;
this.ormsettings = {};
this.ormsettings.datasource = “db_orrms_dev”;
this.ormsettings.cfclocation = this.mappings[“models”];
this.ormsettings.eventhandling = false;

variables.moment = createobject(‘component’,‘myappname.server.utils.moment’);

function onApplicationStart()
{
Application.dtmDateTime.dtmORSchedLastUpdated = 1;
}

function onRequestStart()
{
this.getApplicationSettings();
this.getRequestSettings();
}

function getApplicationSettings(){

  Application.strVersion = "v2013";

}

function getRequestSettings(){

     this.getApplicationSettings();

}

}

It’s probably worth noting that Cage originally posted this on the Taffy
mailing list but I asked him to bring it here because it sounds like either
he has a weird (or wrong?) ORM config or possibly a Lucee ORM bug, to me.

AdamOn Sunday, May 10, 2015 at 8:47:56 AM UTC-4, Cage Sarin wrote:

Hi all,

I’m coming across a bit of a problem and not sure what’s going on.

If i run the following query via Taffy REST service, I get no results.

If it run it via a normal CFC, I get lots of results.

If i run it via Taffy but remove the activeae and activene parts
(booleans), then it returns the correct results. I’ve tried activeae=true
and activeae=1 with same results.

Any thoughts on what could be going on? Is it a Taffy bug? Or a
hibernate/ORM one? I’m including my Application cfc files below. Running Lucee
4.5.1.000 final and Postgresql 9.

Thanks,
Cage

var orsforpod = ormExecuteQuery(“select distinct t2 from roomsettings t2
where t2.validfor=:validfor
and t2.orpodid=:orpodid
and (t2.activeae=‘t’ or t2.activene=‘t’)”,
{validfor=validfor, orpodid=orpodid});

My taffy is in my approot/apiv1/ directory with the following Application.cfc:

component extends=“taffy.core.api”{
this.name = “myappnameapi”;
this.ormEnabled = true;
/* ORM Setting not suggested for production use*/
this.ormsettings = {datasource = “db_dev”, cfclocation = “…/models”, eventhandling = true};

header name="Access-Control-Allow-Origin" value="*";

variables.framework = {};
variables.framework.serializer = "myappname.server.apiv1.resources.CustomRepresentationClass";

variables.moment = createobject(‘component’,‘myappname.server.utils.moment’);

function onApplicationStart()
{
    application.anythingToXml = createObject("component", "taffy.anythingtoxml.AnythingToXML").init();
    application.ormsettings = this.ormsettings;
    return super.onApplicationStart();
}

function onRequestStart()
{
    return super.onRequestStart();
}

}

My models are in approot/models/ directory.

My application is in approot/ directory with the following Application.cfc

component {

this.name=“myappname”;
this.clientmanagement=“true”;
this.sessionmanagement=“true”;
this.setclientcookies=“true”;
this.setdomaincookies=“false”;
this.sessiontimeout=createTimeSpan(0,2,0,0);
this.applicationtimeout=createTimeSpan(1,0,0,0);
this.loginstorage=“session”;
this.ormEnabled = true;
this.mappings[“models”] = getDirectoryFromPath(getCurrentTemplatePath()) & “models”;
this.ormsettings = {};
this.ormsettings.datasource = “db_orrms_dev”;
this.ormsettings.cfclocation = this.mappings[“models”];
this.ormsettings.eventhandling = false;

variables.moment = createobject(‘component’,‘myappname.server.utils.moment’);

function onApplicationStart()
{
Application.dtmDateTime.dtmORSchedLastUpdated = 1;
}

function onRequestStart()
{
this.getApplicationSettings();
this.getRequestSettings();
}

function getApplicationSettings(){

  Application.strVersion = "v2013";

}

function getRequestSettings(){

     this.getApplicationSettings();

}

}

Oh thanks but that’s just when i pasted and edited the code. I modified
some names here and there but i forgot to the change that one…the
datasource’s are the same in the real code…On Tuesday, May 12, 2015 at 6:57:52 AM UTC-4, Jeroen Knoef wrote:

Sorry if I’m stating something obvious, but your datasources are different
between the two application cfc’s.

Jeroen

Sorry if I’m stating something obvious, but your datasources are different
between the two application cfc’s.

Jeroen

Anyone have any thoughts or ideas how I can debug this? Would be greatly appreciated …