5.3.2.077 / Win10 with MSSQL: ORM: the is no session for the datasource

Hi,
i’m trying to get the ORM working with our MSSQL Database.

I’ve added the datasource and a cfquery with the datasource is working.

My application.cfc has the following options:

component {
	this.Name = "Lucee";
	this.ormEnabled="true";
	this.datasource="db1";
	this.ormSettings = {
        dbCreate = "none",
        useDBForMapping = false,
        dialect = "MicrosoftSQLServer"
    };	
}

ormExecuteQuery(“from test”); is not working. I always get the exception:

there is no Session for the datasource [db1]

Additional hint: the table test already exists for the datasource

what i am missing?

Kind regards and many thanks for your support
Michael

First, you create the CFC file, the name of the component should be the same as the DB table name.

And then Set attribute persistent=" true " in the component file for access the table, then set the property for each table columns.

Then run your file that returns the output as an array object. Here below I upload my test file, It returns as expected testOrm.zip (856 Bytes)

Could you please check with that.

Hi cfmitrah,

i’ve done some work / changes in the meantime and my code (and yours) is working now.

Unfortunately i have no copy of the file to reproduce the error from yesterday. After receiving your zip-File iv’e tried to reproduce the problem but without success…

Sorry for that and let’s hope that your zip-File helps some other orm-newbies to get this running wo that your work was not in vain.

Kind regards
Michael